4 ms·
tmux has geek appeal and I can see the use case for remote sessions, but for local macos dev I've changed to just use iTerm for splits (I tried byobu as well).
by hnzix 9y ago
tmux has geek appeal and I can see the use case for remote sessions, but for local macos dev I've changed to just use iTerm for splits (I tried byobu as well).
tmux seems to need extra yak shaving to get vim integration, copy/paste and scrollback configured nicely and I just couldn't see the benefit over iTerm's native functionality.
Can anyone sell me on tmux over iTerm for local dev?
- stefco_ 9y agoI don't think it's very useful for local dev, but it is a lifesaver for SSH work on spotty connections (or any other case where you might want to leave a workspace intact despite losing connection). But if you're already using iTerm, you should just use its built in tmux integration, which lets you keep using iTerm splits and windows while iTerm handles the tmux stuff. You can do this by launching tmux with the -CC option: tmux -CC attach || tmux -CC This is one of my favorite things about iTerm! Combine that with custom profiles for each server and automatic profile switching (and a few other gems), and working remotely is scarcely harder than working locally! The vim stuff is not too hard to get around IIRC. I don't remember the details, but you can have a look at my .vimrc [0] if you want an example that works on remote servers through tmux with iterm. [0] https://github.com/stefco/dotfiles/blob/master/linkfiles/.vimrc https://github.com/stefco/dotfiles/blob/master/linkfiles/.vi...
- ephimetheus 9y agoI used to do that, but eventually switched to just raw tmux. If you add automatic tmux session saving (via plugin) this becomes a lot more convenient. Also allows me to have one iTerm tab for each server and display the tmux session from that server. Nested tmuxes do not work very well, even if the outer one is managed by iTerm.
- joshka 9y agoI was in the same boat as you until I realized that I usually run a tmux session for longer than the period between iTerm updates. tmux -CC + bury tmux session setting is awesome.
- silves89 9y agoI develop using Linux but sometimes I have to use macOS. Mostly I work locally but sometimes I work on remote boxes. tmux means I get a consistent experience where ever I am. I'm not fully versed in what iTerm can do but tmux does splits and tabs. The tabs are very useful. I can also use tmuxinator so I can start up with a standard set of splits and tabs very quickly. There are the issues you mentioned. But once it's configured I don't find those troubling. And once you change the prefix to something sane it's really nice to use. I enjoy moving around tmux. So for me there are big benefits and tmux is one of the first things I install on a new machine.
- laurent123456 9y agoI use the same config in Windows, macOS and Linux so I just need to learn once the shortcuts and it works the same everywhere. I also use it along tmuxinator, which is very convenient to setup sessions. I just need to type "tmuxinator my-project" and it opens the tabs and layouts in the right directories for this project, with "tail -f" running in some panes, mysql client in others, an SSH connection in yet another. Tmuxinator makes configuring all this very straightforward. Scrollback was a bit annoying at first but I got used to it and it's no longer an issue. Copy and paste can indeed still be an issue especially when sshing to a server.
- adrianN 9y agoCan you script iTerm? I usually set up tmux scripts that start a workspace for a project. Splits are set up, a compilation run is started, vim is started with the right files for the project, things like that. Then I can just my_project/start_work.sh and everything is set up the way I like it.
- cormacrelf 9y agoAlacritty. Butter-smooth scrolling as you hold down j in vim. Doesn't have its own scrollback, so use tmux just for that. There is so much less TUI lag, it's on par with using a regular GUI text editor. https://github.com/jwilm/alacritty https://github.com/jwilm/alacritty
- hnzix 9y agoInteresting. Could you use the mouse to interact with scrollback using your workflow? I mostly use keyboard but sometimes I just want to flick upwards and copy a block of scrollback text using the mouse.
- cormacrelf 9y agoYes, through tmux config. https://gist.github.com/sijad/771426b3995eb05faeb6d78926645e56#file-tmux-conf-L72 https://gist.github.com/sijad/771426b3995eb05faeb6d78926645e... Found in https://github.com/jwilm/alacritty/issues/146 https://github.com/jwilm/alacritty/issues/146 Alacritty might get mouse modifiers to use its own text selection (better for a remote session), but that's good enough for me. I use, for extra vim niceness: setw -g mode-keys vi bind-key -T copy-mode-vi 'v' send -X begin-selection bind-key -T copy-mode-vi 'y' send -X copy-pipe-and-cancel "reattach-to-user-namespace pbcopy" bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel "reattach-to-user-namespace pbcopy"