My favorite antipattern is, you can just leave a script that does an event loop running in the foreground, detatch tmux, and voila, you have a 'server'. Works great in a pinch or when you just don't need to finish it.
Getting Started with Tmux
151–160 of 160 posts
Re: Getting Started with Tmux
#152Earlier quoted context omitted.
I use kitty locally and only usr tmux on remote servers where I would not like to lose my session. Running remote tmux inside a local tmux is just to error prone and forces you to remember different bindings.
There is an approach to use tmux inside tmux without using different set of keybindings. That's what I have been using for couple years and I really like the setup. I have the following binding in my local machine: bind -T root F3 \ set prefix None \;\ set key-table off \;\ set status-left '#[bg=#C678DD,fg=#2C323C](pass-#S)' \;\ set status-style bg=#E06C75 \;\ set window-status-current-style bg=magenta,fg=black \;\ r…
Re: Getting Started with Tmux
#153I've used Tmux/Screen the few times I've had to be in an actual terminal, but don't really see the use for them when using a GUI terminal emulator. I just open new tabs or (rarely) windows as needed. Could anyone using these explain what it provides that you find useful in practice? I rarely ever need persistence of shell when I close the console, is that a common need? Familiarity/muscle memory of shortcuts is a val…
Say you have a document you are working on in LaTeX over a few weeks. You might have the command line for compiling, bibtex, and git in one pane, then vim or equivalent in another. Now say you will be moving between home, office, and traveling. If the tmux session is hosted at work you can connect from anywhere and be in the same workspace with the same command history. If you have a dozen other projects happening at…
Re: Getting Started with Tmux
#154The best way to use tmux is with -CC, which iTerm maps to native UI. tmux tabs and panes become native tabs and panes and your session is immortal, and it’s a far better experience than mosh or whatever the latest thing in this area is. I have never bothered to figure out how the keybindings actually work and I probably never will, but I enjoy using it all the time because of this.
Re: Getting Started with Tmux
#155The best way to use tmux is with -CC, which iTerm maps to native UI. tmux tabs and panes become native tabs and panes and your session is immortal, and it’s a far better experience than mosh or whatever the latest thing in this area is. I have never bothered to figure out how the keybindings actually work and I probably never will, but I enjoy using it all the time because of this.
Re: Getting Started with Tmux
#156Earlier quoted context omitted.
Oh ya, I'm not against function keys or anything, just not for me. Switching to vim 10+ years ago made all my RSI problems go away so now I just like to keep my fingers on the letter keys as much as possible. I don't even like stretching to number row when I can avoid it (though I do all the time, of course).
This sounds silly when I say it out loud, but reaching for the number row always felt like a chore. Of course, when I had to input numbers, I'd still have to reach for the number row. But when numbers were optional, say for vim bindings that take a `[count]`, I opted to look for alternatives instead. A few months ago however, I bought a moonlander keyboard. Now, I've got one of it's keys that, when held, maps the rig…
Another comment in here made think about using Karabiner to give myself a keypad with uiojklnm,. (or something). I actually did this when I used to use a flash-able mechanical keyboard, but I like working on my couch too much so I've been all-in on the short-scale apple keyboards for several years now.
Re: Getting Started with Tmux
#157Tmux becomes more awesome when you use something like Alacritty or Kitty [EDIT: scratch Kitty, this mainly applies to Alacritty] and map your system's key (Apple's command key or... whatever it would be on Linux or Windows) and use that as your "tmux key". That way you can make single-chord bindings for all things tmux and life becomes better. If you use Vim, adding VimTmuxNavigator[0] improves things so much. For ex…
Re: Getting Started with Tmux
#158The best way to use tmux is with -CC, which iTerm maps to native UI. tmux tabs and panes become native tabs and panes and your session is immortal, and it’s a far better experience than mosh or whatever the latest thing in this area is. I have never bothered to figure out how the keybindings actually work and I probably never will, but I enjoy using it all the time because of this.
Is there yet any linux terminal that supports tmux -CC mode? iTerm is not coming to Linux, and using tmux on anything else feels really meh.
I thought there was another one, but searching for "tmux" in the issues of the major terminal emulators is worthless since there are so many pages
Re: Getting Started with Tmux
#159I've only used tmux for about One of my favorite scripts to run is a tmux script that creates a new session with about 7 windows of running my company's project (one window for notes, 3 windows for the backend (runner, code, tests), and 3 windows for the client (runner, code, tests). It's even tweaked further to open up the code in vim, and when used in conjunction with something like harpoon.nvim I have access to my…
Could you please share your script?
#!/usr/bin/env bash
tmux new-session -d -s sessionname
tmux rename-window todo
tmux send-keys -t todo "vim todo" Enter
tmux new-window -d -n dot
tmux send-keys -t dot "cd " Enter
tmux new-window -d -n windowname
tmux send-keys -t windowname "cd ~/reponame" Enter
tmux send-keys -t windowname "commands to run" Enter
tmux attach-session -d -t sessionname
Re: Getting Started with Tmux
#160Tmux becomes more awesome when you use something like Alacritty or Kitty [EDIT: scratch Kitty, this mainly applies to Alacritty] and map your system's key (Apple's command key or... whatever it would be on Linux or Windows) and use that as your "tmux key". That way you can make single-chord bindings for all things tmux and life becomes better. If you use Vim, adding VimTmuxNavigator[0] improves things so much. For ex…
Interestingly enough, one of the stated goals of kitty is to make the usage of tmux unnecessary. Considering your comment (and many others like it), I don't think that has quite worked out. Still, kitty is one of my favorite terminal emulators and I'd urge anyone who hasn't tried it to give it a shot.