Skip to content

Conversation

@MichaelJosephKramer
Copy link

  • Add the --tmux command line option
  • Prefix the key in the authorized keys file with a command that
    immediately directs the pair to the tmux session when the option is added
  • Remove tmux prefix and the key when the key is removed

This feature is based on the pairing setup here: http://www.zeespencer.com/articles/building-a-remote-pairing-setup/. I got tired of pasting the tmux prefix manually, so I added a command line option to add it for me.

Despite the spirt of pairing, I hackety-hacked this solo, so please let me know if you have any suggestions/improvements. Thanks!

- Add the --tmux command line option
- Prefix the key in the authorized keys file with a command that
  immediately directs the pair to the tmux session when the option is added
- Remove tmux prefix and the key when the key is removed
@jasonkarns
Copy link

👍

Though perhaps the flag should be just --ssh-options and the environment variable GH_AUTH_SSH_OPTIONS, since this feature need not be limited to tmux commands. Indeed, half of the options don't have anything to do with tmux at all. (no-port-forwarding,no-X11-forwarding,no-agent-forwarding)

@chrishunt
Copy link
Owner

Awesome idea! Thank you much. I was working on moving v3.0.0 over to Thor, so I wasn't able to merge this in, but I added the --command option which should do the trick. Closing this out.

$ gh-auth add --users=chrishunt --command="tmux attach"
Adding 2 key(s) to '/Users/chris/.ssh/authorized_keys'

$ cat ~/.ssh/authorized_keys
command="tmux attach" ssh-rsa ... https://github.com/chrishunt

@chrishunt chrishunt closed this Oct 25, 2013
@chrishunt chrishunt mentioned this pull request Nov 15, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants