Live data from Hacker News

Tmux for Mere Mortals

zserge.com

111–120 of 171 posts

Re: Tmux for Mere Mortals

#111
post #106
post #98

Earlier quoted context omitted.

They are local projects, but you can be ssh'd into another server from a tmux session / window. A tmux window or split window is just another terminal at the end of the day.

Having them remote also saves you from the window-update-hell, which annoys me no end. You can save the session and log out. As I said in another post, I was a heavy tmux user until I started using Fluxbox. But tmux definitely had advantages. Now in the WFH world it's a good opportunity to try to optimize the workflow again.

Absolutely, it's invaluable for just this feature. Also for digital nomad type workers who often have inferior internet to work with, and for being at the same exact spot when you left the office and get home to wrap up that last bit of work. Just reattach session and keep going. I also like to keep a freenode pane open that stays relatively uninterrupted.

Re: Tmux for Mere Mortals

#112

Can someone please please make a util that configures tmux for me? 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…

No, it wouldn't. Your examples are mostly hints that it's actually your terminal emulator (which might also serve as your "SSH program" in cases like PuTTY) which might need a slap to behave correctly - and then your TERM environment variable and possibly LANG (UTF-8 support) should be set up correctly. tmux will work then.

Re: Tmux for Mere Mortals

#114

If you use vim as your IDE and haven't already, make use of nerdtree with its git addon[1] along with tmux. 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...

How are you setting your tmux colours in different environments?

Re: Tmux for Mere Mortals

#115
On my side, here's how I configured my mac.

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).

Re: Tmux for Mere Mortals

#116
post #14
post #9

Earlier quoted context omitted.

I’ve always done: > Mod+| for vertical split > Mod+- for horizontal split I’ve been using it like that for years, but haven’t seen it in too many places like that. It just feels super logical since the symbols look like the split!

I've been using those for some time, before I met German keyboards with weird layouts. Now I try to stick to alphanumeric symbols only.

I was born in France, so grew up with one of the weirdest ISO layout: "AZERTY".[1]

The worst offense is not even A-Z but rather symbols — take the key "ù" for instance: it's a non-mod key that is used for 1 single word in the entire French language. Literally, ONE WORD in the dictionary. And you need to Shift that 'ù' key to get '%'. How stupid is that...

I won't even comment on the weird 'M' position, which shortens the bottom row (index hits no letter, it's a symbol...) Like WTF, seriously.

Also, top row requires Shift for numbers... (no modifier yields symbols...) What a strange, impractical decision. Every number requires pressing a modifier, but underscore or '&' do not... Sure, yeah, OK.

Should we talk about period '.' requiring a Shift, but not ';' No, no we shouldn't. It's not like a period is common in language...

I thus call it 'weirdest', because it's as far as it gets from ANSI, and it has to be the worst ISO I've ever tried altogether. The question is, why do it so differently? Why not change as little as necessary based on ANSI? Was it a misguided sense of cultural appropriation? Did they like torturing typists and programmers alike?

So one day, as I was learning programming, I decided to stop fighting my keyboard, to preserve my sanity (and limit RSI).

QWERTY US (ANSI) is simply the best for tech (IT, prog). Not necessarily inherently (although it's very good for language), but because of the chicken-and-the-egg: most software is designed by/for US companies and programmers, so symbols like e.g. []{}|/ are used in programming, bash, tools, because they are easy to use on a QWERTY keyboard. And I vastly prefer the 1-row wide Enter to the inverted-L shaped ISO style (less RSI-inducing on the right pinky).

For non-US programmers, there's life before, and after switching to ANSI-US. I'm not even kidding, it's a life-changer in simplicity, comfort (ergonomics) and generally intuition— e.g. there's a reason why ()[]{} are close by. And it lets one buy keyboards anywhere (you'll always find QWERTY, but good luck finding ISO-XX in country YY.

Thank you to anyone who read this. I hope you feel the pain. Now revel in the fact that you weren't born in France and did not have to suffer the computer illiteracy and impractical engineering design of an entire generation before you.

/rant

I don't know if French AZERTY is funny or appalling, I'll let you be the judge of that; I just need to vent 25 years of frustration every now and then, even 10+ years later.

____

[1]: https://upload.wikimedia.org/wikipedia/commons/b/b9/KB_Franc...

Re: Tmux for Mere Mortals

#117
post #79
post #10

Spent too much time wonking a tmux config only realizing it was never going to work how I liked. You can't have it all with the mouse no matter your settings, there will always be a compromise. It also doesn't help that no one cites the version of tmux they wrote their configs for, nor that the configs are not backwards compatible with all versions of tmux for all settings. It's really clunky, but I went from tmux to…

> You can't have it all with the mouse no matter your settings I don't think this is correct; it's just that it's not trivial to get things working well. As you say, it depends on using an up-to-date version of tmux (and sadly, you often can't run a config made for a new version with an older version of tmux). And you'll need your terminal to be up to the task (eg. iTerm2 on macOS; not sure what the best thing on Lin…

I couldnt figure out how to get the mouse behavior I liked working in the shell as well as in editors like less or nano. Id get the shell able to scroll and work well with selecting text, then Id have some archaic mouse behavior in my editors. Or I could have the editors working like they do outside of tmux, but then I lose the ability to scroll in the shell and whole tmux multipane window scrolls off screen instead. I could get into the keybinds, but I dont use vim so they are pretty ancient and foreign to me. The effort for me to learn these binds doesn't seem there compared to just moving my windows with the mouse once or twice a day.

Re: Tmux for Mere Mortals

#118
post #109

Earlier quoted context omitted.

Oh so many useful utilities to write. Folks often say "what should I do with my programming skills?" when there are endless tools, whos lack hold us back. My favorite would be a tool that wrote a Linux device tree source file, by digesting the board schematic. Port Linux to your new device with one click! Of course, that would take away a large part of my contracts. I'd have to do some real work for a change.

If you build it yourself you could easily continue those contracts with way less work put in. There's many, many jobs out there that exist only because people don't think they can read the documentation and figure out how to run things themselves. If the contracts start to dry up, offer it as an automated service. Look at how many people still pay to have someone install and configure things like Wordpress. There's l…

Only if he’s a freelancer. If he works for a company, they could just take this piece of work product that he made, use it in all the ways your just described, and then lay him off.

Re: Tmux for Mere Mortals

#120
post #34

So I predominantly use Macs. The one and only reason why I personally use tmux is because of tmux -CC. I never bothered with screen/tmux simply because I didn't want to learn another whole new set of keybinds (let alone reconfigure them). tmux -CC largely behaves as a native app. Want a new tab? CMD+T. New window? CMD+N. Scrollback with the trackpad. That sort of thing. The complete system is iterm2 + tmux -CC + et (…

How is the behavior in et compared to setting up a no kill signal from your ssh config? Sometimes my no kill signals get killed after a half hour or longer.
Post reply on HN