1

Usually I would background the foreground process using ctrl-z, but when running in tmux with the prefix key bound to z, then obviously ctrl-z just invokes tmux. Likewise if I try to escape the ctrl-z by hitting 'ctrl-z z' then it switches tmux panes (as designed).

Is there another way I can background then foreground process in tmux without having to change the prefix key?

3

I'm assuming your prefix char is C-z. The default prefix of C-b comes with a default binding of C-b (given after the prefix) to the tmux command send-prefix. This means you type C-b twice to get a real C-b sent. You could do the same with C-z for example:

set-option -g prefix C-z
bind-key C-z send-prefix

Now you type C-z twice to background the current process.

If your prefix really is z, then C-z should normally background the current process without the need for a prefix. You can try adding unbind-key C-z if it doesn't, or bind-key C-z send-keys C-z if you want zC-z to do it.

  • Yeah, C-z is the prefix char. You're right, binding any key to send-prefix does the job. Turns out I had mine set to v the whole time with: bind v send-prefix. – mekazu Nov 14 '18 at 11:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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