All Projects → airbnb → appear

airbnb / appear

Licence: MIT license
reveal terminal programs in the gui

Programming Languages

ruby
36898 projects - #4 most used programming language
shell
77523 projects

Projects that are alternatives of or similar to appear

dotfiles
A place to store config files so I can revert when my entire system crashes from entering the wrong character
Stars: ✭ 25 (-13.79%)
Mutual labels:  tmux, iterm2
Jarvis
Dotfiles for a powerful, web development-focused environment powered by Neovim, iTerm2, tmux, and zsh
Stars: ✭ 617 (+2027.59%)
Mutual labels:  tmux, iterm2
dotfiles
dotfiles for the command line home
Stars: ✭ 21 (-27.59%)
Mutual labels:  tmux, iterm2
dotfiles
Current: Neovim, Tmux, FishShell. Old but still there: prezto, zsh.
Stars: ✭ 46 (+58.62%)
Mutual labels:  tmux, iterm2
Mac Bootstrap
💻 Provision a new Mac for web development with dotfiles + Fish/Zsh, Neovim, and Tmux
Stars: ✭ 96 (+231.03%)
Mutual labels:  tmux, iterm2
dotfiles
My dotfiles for oh-my-zsh, vim and tmux 📟
Stars: ✭ 23 (-20.69%)
Mutual labels:  tmux, iterm2
Radian
🍉 Dotfiles that marry elegance and practicality.
Stars: ✭ 274 (+844.83%)
Mutual labels:  tmux, iterm2
Dotfiles
🔘 neovim, zsh, tmux, iTerm2, macOS dotfiles
Stars: ✭ 7 (-75.86%)
Mutual labels:  tmux, iterm2
Dotfiles
👾 ~/
Stars: ✭ 91 (+213.79%)
Mutual labels:  tmux, iterm2
Wincent
💾 Dot-files
Stars: ✭ 882 (+2941.38%)
Mutual labels:  tmux, iterm2
Sendcode
Send code and text to macOS and Linux Terminals, iTerm, ConEmu, Cmder, Tmux, Terminus; R (RStudio), Julia, IPython.
Stars: ✭ 166 (+472.41%)
Mutual labels:  tmux, iterm2
Dotfiles
📍 My dotfiles for macOS using Fish/Zsh, Neovim, and Tmux
Stars: ✭ 151 (+420.69%)
Mutual labels:  tmux, iterm2
squidgefiles
Beautiful dotfiles 🦑
Stars: ✭ 20 (-31.03%)
Mutual labels:  tmux, iterm2
dotfiles
shell, git, vim, tmux .etc dotfiles, managed via gnu stow
Stars: ✭ 20 (-31.03%)
Mutual labels:  tmux
ssh-tools
😭没找到好用的shell工具✌️自己实现类似Xshell的部分功能
Stars: ✭ 92 (+217.24%)
Mutual labels:  iterm2
configuration
Config files
Stars: ✭ 12 (-58.62%)
Mutual labels:  tmux
tdab
Create side and top bars in tmux easily, along with a "devour" style command.
Stars: ✭ 14 (-51.72%)
Mutual labels:  tmux
dotfiles
My dotfiles
Stars: ✭ 204 (+603.45%)
Mutual labels:  tmux
drop-in
Remote workspace
Stars: ✭ 47 (+62.07%)
Mutual labels:  tmux
dotfiles
My bash / zsh / vim / pry settings
Stars: ✭ 88 (+203.45%)
Mutual labels:  iterm2

Appear

Appear your terminal programs in your gui!

GitHub repo Build Status Gem Version

Docs: current gem, github master, your branch: bundle exec rake doc

screenshot demo thing

Appear is a tool for revealing a given process in your terminal. Given a process ID, appear finds the terminal emulator view (be it a window, tab, or pane) containing that process and shows it to you. Appear understands terminal multiplexers like tmux, so if your target process is in a multiplexer session, appear will reveal a client connected to that session, or start one if needed.

This project intends to support all POSIX operating systems eventually, but currently only supports macOS.

usage

Usage: appear [OPTION]... [PID]
Appear PID in your user interface.
Appear will use the current process PID by default.

Options:
    -l, --log-file [PATH]            log to a file
    -v, --verbose                    tell many tales about how the appear process is going
        --record-runs                record every executed command as a JSON file in the appear spec folder
        --version                    show version information, then exit
    -?, -h, --help                   show this help, then exit

Exit status:
  0  if successfully revealed something,
  1  if an exception occurred,
  2  if there were no errors, but nothing was revealed.

supported terminal emulators

macOS:

  • iTerm2
  • Terminal

cross-platform:

  • tmux

GNU Screen support is a non-goal. It's time for screen users to switch to tmux.

system requirements

  • ruby >= 1.9.3
  • lsof command
  • ps command
  • pgrep command
  • if you're a mac, then you should have macOS >= 10.10

Appear depends only on the Ruby standard library.

how it works

Here's how Appear works in a nutshell, given a target_pid

  1. get all the parent processes of target_pid, up to pid1. We end up with a list of ProcessInfos, which have fields {pid, parent_pid, command, name}
  2. go through our list of "revealers", one for each terminal emulator (tmux, iterm2, terminal.app) and ask the revealer if it can apply itself to the process tree.
  3. if a revealer finds an associated process in the tree (eg, tmux revealer finds the tmux server process), it performs its reveal action
    • this usually involves invoking lsof on a /dev/ttys* device to see what processes are talking on what ttys to each other, which takes a bunch of time
    • lsof in Appear is parallel, so grouped lsof calls are less expensive
    • the Tmux revealer is smart enough to both focus the pane that the target_pid is running in, AND to recurse the revealing process with the tmux client id, to reveal the tmux client.
  4. the revealer sends some instructions to the terminal emulator that contains the view for the PID
    • for our Mac apps, this involves a helper process using Javascript for Automation, a JavaScript x Applescript crossover episode.
    • for tmux this is just some shell commands, super easy.

ruby api

The method documented here is the only part of Appear that should be considered stable.

require 'appear'

# super simple
Appear.appear(pid)

# You may customize logging, if needed, using the Config class
config = Appear::Config.new

# print debug info to STDOUT
config.silent = false
# also write to a log file
config.log_file = '/tmp/my-app-appear.log'

Appear.appear(pid, config)

contributing

First, get yourself set up:

  1. make sure you have bundler. gem install bundler
  2. inside a git clone of the project, run ./scripts/setup or bundle install

Then, submit PRs from feature branches for review:

  1. git checkout -b my-name--my-branch-topic
  2. write code
  3. run ./scripts/console for a nice pry session with an instance ready to go
  4. run bundle exec rake to run tests and doc coverage
  5. commit and push your changes, however you do
  6. open a PR against airbnb master

releasing new versions

You must be a collaborator on Rubygems.org, and a committer on the main repo at https://github.com/airbnb/appear.

  1. update lib/appear/version.rb with the new version number
  2. update CHANGELOG.md with changes in the new version
  3. commit those changes, and merge them to master
  4. checkout master
  5. bundle exec rake release
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].