9

Setting and using Sublime Text 2 as the git editor does not wait correctly within a tmux session.

$ tmux
$ export EDITOR="subl -w" 
$ git rebase HEAD^ -i (close file, terminal hangs)

If the EDITOR is set without the wait, then the file is opened in ST2 as before, but then of course the rebase then gets applied immediately within the shell.

1
  • Just wanted to note that I am experiencing the same problem with tmux and sublime. May 20, 2013 at 8:59

1 Answer 1

7

I do not use Sublime Text, but I have read a question on Super User that seems to be about this same problem.

The solution involves using the “wrapper” program that I made to allow pasteboard access inside tmux. The “fix” is not specific to pasteboard access, so the program also turns out to alleviate problems in several other areas that are not related to cut/copy/paste operations. The method that Sublime Text uses to implement the “wait” feature of subl -w invocations seems to be one of these “other areas”.

You can get the wrapper through MacPorts from their tmux-pasteboard port, or through Homebrew from their reattach-to-user-namespace formula, or compile it yourself from my tmux-MacOSX-pasteboard repository at GitHub.

Once you have it installed, you may want to configure (per the README) a default-command in your .tmux.conf so that shells spawned inside tmux will automatically be “reattached”. Alternatively, you could use the wrapper in your EDITOR value:

EDITOR='reattach-to-user-namespace subl -w'
1
  • The .tmux.conf change didn't work for me, but explicitly adding it to the EDITOR did — thanks!
    – Jon Reid
    Nov 25, 2014 at 21:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.