by _7ffc on 4/28/20, 5:10 AM with 166 comments
by asdff on 4/28/20, 6:26 AM
It's really clunky, but I went from tmux to just opening new shell windows as needed. I need to be able to resize and scroll, selecting text and copy behavior should be exactly like mac os. Even used a tiling window manager with it for a bit, but it felt pretty restrictive so I went back to just using the cursor to move things around.
by VikingCoder on 4/28/20, 2:01 PM
I'd like to run a small program that generates a tmux.conf, after asking me some questions, and having me demonstrate my responses.
So step one, it should be able to figure out what version of tmux I'm using. Then it probably needs to know what SSH program I'm using, so it knows how the keyboard and mouse from that program will mess with it.
Picture a Wizard where it asks, "Do you use the mouse to copy and paste? Try to highlight this text: [example1]. Then try to paste it back into this screen." and etc.
Wouldn't this be... kind of an obvious thing to make?
by hhsuey on 4/28/20, 7:12 AM
- Iterm2 can now restore sessions, even partially after a reboot (attempts to recreate workspaces). This was the main benefit of tmux for me.
- Iterm2 can also have a visual mode to browse your scrollback buffer, and there are some shortcuts similar to vim. This was the second main benefit of tmux for me.
- It's less keybindings to remember and configure.
- Iterm2 can better size your split panes. You can also change text size per pane. Useful for wide text.
- A bunch of other things that iterm2 does better when tmux is not open. Autocomplete. Paste history. Instant replay. Some of these are quite gimmicky TBH, but could be useful for some.
- Text, colors, etc... appear sharper without tmux. I think. There are antialiasing configs you can mess around with in Iterm2 at least.
- Shell integration. Jump to your last shell prompts in scrollback. Highlight all your prompts in all your panes. Then move to those panes with your mouse without clicking. Amazing.
by nickjj on 4/28/20, 12:12 PM
It covers how I use tmux sessions, windows and splits along with Vim buffers / splits / tabs to manage my work flow for developing applications and switching to different projects within seconds.
Despite the video being almost a year old, I work in the exact same way today. It's been a very wonderful experience. My dotfiles are included at the bottom of the post if you wanted to poke around the configs.
by cletus on 4/28/20, 7:27 AM
The complete system is iterm2 + tmux -CC + et (EternalTerminal) for persistent ssh connections.
by dustinkirkland on 4/28/20, 4:53 PM
by ssivark on 4/28/20, 5:57 AM
BTW, for any newbies looking to start out with tiling window managers, I would highly recommend Regolith (which is basically i3 with a nice set of conventions).
by necrotic_comp on 4/28/20, 12:33 PM
This is nice in isolation, but it becomes powerful if you have a persistent target and have a keybinding to issue a send-keys command to the persistent target.
For instance, in my vimrc, I have a set of commands bound like so:
noremap <leader>R :silent !tmux send-keys -t 2.2 startjob Enter <CR>
noremap <leader>E :silent !tmux send-keys -t 2.2 killjob Enter <CR>
where startjob is a local alias to starting my development environment and 2.2 is the target.
This means from any of the vim instances I have, I can start and stop my development environment without having to do so in a running vim instance, and get all the appropriate logging in a terminal that I can switch to when I choose.
This becomes even more powerful with a build script I have triggered by an inotifywait that's running in 2.1 that will build my entire environment with all its dependencies (yes, I need to do it this way because building one project may require another to be rebuilt, and just triggering 'make' in vim doesn't cut it) whenever a file is written.
It reduces a lot of the pain with developing a C++ project in the terminal and lets me get back to the work of just thinking about what needs to be done.
'Send-keys' is, to me, the killer feature of tmux.
by kyuudou on 4/28/20, 2:53 PM
I use different tmux colors for different environments so I know where I'm at instantly.
[1]https://medium.com/@victormours/a-better-nerdtree-setup-3d39...
by didibus on 4/28/20, 7:26 AM
Provides a nice user friendly layer on top of tmux, much recommended.
by jeroenjanssens on 4/28/20, 8:26 AM
by rshnotsecure on 4/28/20, 5:52 AM
Fun Fact: Google Cloud Shell is by default Tmux. You can tell, because you don't need to start Tmux up ever if you are in it. Simply hit something like ctrl+b++" and watch your terminal split in two.
by cachestash on 4/28/20, 7:17 AM
by thom on 4/28/20, 8:34 AM
by mcjiggerlog on 4/28/20, 9:01 AM
My tmux bindings are also different, but the logic behind them is the same. Mine are available here - https://github.com/tom-james-watson/dotfiles
by K0SM0S on 4/28/20, 6:03 AM
I think it's really nice. Well done!
> Mod+V: split vertically
> Mod+B: split horizontally (“bisect”)
That's smart. I love it!
% and " tend to feel... just weird. I can see the visual cue, but it's always been weird to me nonetheless.
by todd3834 on 4/28/20, 6:15 AM
Personally I like to try the defaults for a reasonable length of time to see if there is maybe some logic behind why they were chosen. I’ve gotten so used to the defaults now that I don’t think I would change too much except for this one thing:
- Opening a new pane or window was customized to start in the folder where the command was originated from.
by opan on 4/28/20, 8:07 PM
by swiley on 4/28/20, 12:15 PM
Personally I use it to organize VT sessions by topic; I’ll make a tmux socket in the root of a project (or at work, ticket) folder and leave things like vim running, that way I never end up loosing vim and opening it twice. You still need a window manager in addition to this to handle efermal windows (browsers, REPLs, other VTs with tmux for other projects etc.)
Also it keeps things from getting SIGHUP. Some fancy VT app probably isn’t going to do that and it’s certainly not going to do it in a platform agnostic way.
by gfiorav on 4/28/20, 10:51 AM
by dfee on 4/28/20, 7:21 AM
by kohtatsu on 4/28/20, 6:11 AM
# Inherit directory
bind '%' split-window -h -c '#{pane_current_path}'
bind '"' split-window -v -c '#{pane_current_path}'
bind c new-window -c '#{pane_current_path}'
# Vim pane movement
bind h select-pane -L
bind l select-pane -R
bind k select-pane -U
bind j select-pane -D
# Misc
set -g renumber-windows on
set -g escape-time 0
My prefix is Ctrl+F fwiw (on the inner session), I think with capslock as control I wouldn't want to bother remembering and committing to one-stroke bindings.System Preferences > Keyboard > Modifier Keys on Mac, I think it's xkbdmap or such on Linux/X11.
Edit: not to detract from the OP, it looks like they put a lot of thought into the ones they made so I'd do well to give them a shot. I'm happy tmux makes it so easy to bind keys as such.
by ramraj07 on 4/28/20, 7:17 AM
by JanMa on 4/28/20, 10:28 AM
by hx2a on 4/28/20, 12:30 PM
https://pragprog.com/book/bhtmux2/tmux-2
It's a quick read and worth the effort. Available through O'Reilly learning online.
by pot8n on 4/28/20, 6:41 AM
by d0m on 4/28/20, 3:08 PM
Workspace at the top level.
- cmd+f1..f9 --> Switch to workspace. - cmd+ctrl+1..9 --> Also switch to workspace (because fkeys are removed and the touchbar is terrible)
Inside each workspace, I use one app in full-screen.
Workspace 1 = IDE Workspace 2 = Terminals Workspace 3 = Browser Workspace 4-9 depends (Spotify, debugger, etc.)
For each app, I switch between tabs using cmd+1...9.
So intuitively, to jump somewhere, cmd+fX to go to the right workspace, then cmd+X to jump to the right tab. For instance, I know my database logs are always in the first tab of my terminal, so: cmd+f2, cmd+1. (On the mac with touchbar, capslock+cmd+2 then cmd+1 (as capslock is bound to ctrl)).
I try to keep this nomenclature everywhere as much as possible. For instance, in Chrome, cmd+1..N jump to the right tab. I configured vscode to do the same. I also disable any transition animations.
For me, this is so intuitive and fast that I have a hard time using 2 monitors as it's faster to jump to the right place than moving my head around or to find the app using cmd+tab.
Finally, where it makes sense, I sub-divide some tabs in tiles. For instance, my "web server tab" is often divided in 4 tiles. Or my IDE is split in various tiles with the files I'm working on.
I used a similar approach back then when I was using stumpwm on linux and tried to bring it back to my mac with as little configuration change as possible. (I only have to map caps lock to ctrl and tweak a few hotkeys to switch workspaces).
by mkhnews on 4/28/20, 12:51 PM
by jchook on 4/28/20, 4:53 PM
Would make a world of difference for apps like Tmux.
by kps on 4/28/20, 5:16 PM
by hendry on 4/29/20, 4:37 AM
Two problems with this. 1) tmux is slower than a window manager like dwm 2) Why not just use dwm
Personally feel rebinding a tool like tmux will bite you down the road.
by snvzz on 4/28/20, 1:40 PM
It's worth learning the defaults, and it's not that hard. They do make some sense.
by xref on 4/28/20, 8:50 AM
by afarviral on 4/28/20, 5:51 AM
by era86 on 4/28/20, 3:33 PM
by zimpenfish on 4/28/20, 8:32 AM
by strangelove026 on 4/28/20, 7:49 PM
by 0xff00ffee on 4/28/20, 5:28 PM
But who manages THAT many remote sessions? Seems like an upstream problem to me, no?