Live data from Hacker News

Tools I Use - tmux

rdegges.com

41–50 of 61 posts

Re: Tools I Use - tmux

#41
post #4

There are multiple problems with tmux on OS X. pbcopy and pbpaste, for instance, are entirely unusable. Even if tmux has some nice benefits over screen, it probably isn't worth it to the Mac user to switch.

There's a similar-sounding problem in the X11 environment on traditional Unix systems: the current default graphical display is in the $DISPLAY environment variable, while authentication information is in ~/.Xauthority. GNU Screen tends to blindly inherit those settings, so you can freely start GUI apps from inside screen and have everything work... until you try to reattach screen from inside a different GUI session…

GNU Screen allows you to do something similar using its setenv command. For instance, to update the value of $DISPLAY to a new ssh session's value you could run "screen -S foo -X setenv DISPLAY $DISPLAY" before running "screen -r foo".

I have a wrapper script that reproduces tmux's behavior of automatically updating a set of environment variables. It goes a step further and also updates them in your running bash shells. For this to work you have to register a signal handler in your .bashrc that sources a file with the new environment. The script is available at https://github.com/sciurus/splatbang/blob/master/rescreen

Re: Tools I Use - tmux

#42
I went from "Terminal" to "screen" to "tmux" to "stumpwm". Baiscally, what I really liked of tmux is the way I could frame my terminals logically or fullscreen easily. I also really enjoyed the fact that I had multiple "workspace". Basically, my WM was just not appropriate for the way I liked to work. Stump fixed that. It's dynamic, I can hack it from emacs and it has everything I liked about tmux. Obviously, I'm talking from my desktop perspective, if I'm working somewhere else remotely it's a different story.

Re: Tools I Use - tmux

#44
What I don't understand is how both screen and tmux ship with bindings that conflict with readline. Did nobody notice, or did nobody care? Neither is usable without fixing this in config.

Re: Tools I Use - tmux

#45
post #28

I keep having this nagging feeling I should use tmux more often. Right now I use it for remote pairing type stuff, but I can never bring myself to use it regularly. I love tmux, and it's super useful, but I just can't deal with the way it breaks scrolling. tmux and screen both horribly break scrolling and reverse searching. I'm not sure what the fix is, but until that works I can't see myself using it regularly.

CTRL+B (or whatever key to get into tmux mode input) then Page Up/Down to scroll or keyup/down. Then just esc when you are done scrolling. Works fine here, havent needed to mock with settings to make it work like this. But the tildas scrollbar is broken by tmux, and the usual shift+pageup, and mousewheel to scroll... but thats okay.

"setw -g mode-mouse on" in your tmux.conf will let you use the mouse for scrolling and selecting text once you're in copy mode.

Re: Tools I Use - tmux

#46
post #38

I love using terminal multiplexors, but prefer GNU Screen since it is almost always available wherever I need it. For those interested, I use the following to show a status line -- comes in handy when you want to name difference screens. You can always name a screen using "C-a A" hardstatus alwayslastline "%?%{yk}%-Lw%?%{yk}%n*%f %t%?(%u)%?%?%{yk}%+Lw%?"

I prefer GNU Screen for the nethack mode. It is a shame that Screen does not ship with a nicer hardstatusline by default - you can do some really amazing things there.

Re: Tools I Use - tmux

#47
tmux is amazing. A really handy command is send-keys. I use a fullscreen split pane setup with VIM in one and elinks in the other.

Inside my .vimrc:

  command W :wexecute 'silent !tmux send-keys -t 1 C-r'redraw!
This saves the buffer then sends ctr+r to pane 1 (elinks in my case), which causes a page refresh. It's very useful when debugging web scripts.

Re: Tools I Use - tmux

#48

What I don't understand is how both screen and tmux ship with bindings that conflict with readline. Did nobody notice, or did nobody care? Neither is usable without fixing this in config.

How about C-q as an alternative? It is same as C-v (in the default readline mapping) and generally unused. It does not conflict even with Windows' use of C-v.

Re: Tools I Use - tmux

#49

What I don't understand is how both screen and tmux ship with bindings that conflict with readline. Did nobody notice, or did nobody care? Neither is usable without fixing this in config.

Configuring the prefix key to C-z is quite harmless, C-z C-z for suspend is quite ok.

(As a bonus hint, binding subkeys with control it's faster to send commands: C-z C-n is faster than C-z n, you just keep control pressed during the command sequence.)

Re: Tools I Use - tmux

#50
I absolutely love tmux and use it everyday, but the killer feature I really want is tighter integration with a terminal emulator like iterm2. I would love to be able to attach to a tmux session with iterm2 and scroll using two-finger scrolling, while still being able to detach from the session and re-attach remotely.

It would seem like this would be a possibility given tmux's design, which is a lot more flexible than GNU screen's.

Post reply on HN