Live data from Hacker News

Tmux for Mere Mortals

zserge.com

141–150 of 171 posts

Re: Tmux for Mere Mortals

#141
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…

For me tmux isn't about new windows, it's about keeping a session open when my ssh connection dies, or my vpn resets which causes a connection to die, or any of 100 other things that can happen. Tmux keeps my stuff going while I'm not there, and I can come back to it.

Re: Tmux for Mere Mortals

#142
post #132

All I use tmux for is to reattach to sessions after a connection drops. The rest I just configure away as much as possible, but not quite as much as I want. Is there any simpler utility that only provides persistent sessions?

GNU screen?

Re: Tmux for Mere Mortals

#143
post #125

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

Different colors are great even without Tmux. Even in my simple WSL environment I have aliases to open, say, alias liveTerm='urxvt -bg "#5b0000" -fb white &' -so my production ssh will be red, staging green, another site purple, etc.

^^ whoops make that(too late to edit)

    -fg white

Re: Tmux for Mere Mortals

#144
post #40
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!

Could not agree more. I throw in underscore and backslash for good measure too: bind-key | split-window -h bind-key \ split-window -h bind-key - split-window -v bind-key _ split-window -v

This is really helpful. I hadn't thought about adding bindings that work without shift. I just tried this and had to escape the slash to get the second binding to work:

  bind-key \\ split-window -h

Re: Tmux for Mere Mortals

#145

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…

Necessity is the mother of invention. But I think you'll find that when you start writing something like that, you'll eventually learn enough about the config format that you'll no longer need a wizard to create the config for you. Then, it becomes hard to work on the wizard, because the necessity aspect is gone. Another question to ask is, who would pay for it? A lot of people buy services for things that they can d…

Shouldn't tmux core devs be motivated to write a tool like this? Assuming they are interested in attracting more users.

Re: Tmux for Mere Mortals

#146
post #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.

A util like I propose would be able to 1) ask what term / ssh you're using, 2) ask you to demonstrate keystrokes and mice and determine if they're working, 3) offer suggestions for how to fix them.

Re: Tmux for Mere Mortals

#147

Earlier quoted context omitted.

Yes, the mouse situation in tmux is catastrophic. As much as I love tmux, I wonder what would it take that the program respects the usual copy-paste conventions like all the rest of X programs. You need to do two things, that are apparently impossible when tmux has "mouse enabled": 1. select some text in your xterm so that it gets copied 2. middle click on the xterm and your copied text (possibly from other window, w…

This is little to do with tmux and much to do with the features offered to terminal applications by terminal emulators. Both clipboard and mouse support in terminals generally is quite limited. For the clipboard, this page documents how to configure it within the limits of what is possible: https://github.com/tmux/tmux/wiki/Clipboard

That's the main problem with tmux in my experience, whenever I open an issue or a feature request on tmux github, the devs say it's a terminal issue. I then open the same issue on the terminal github and the devs there say it's a tmux problem.

Perhaps a solution could be combining a terminal and tmux into one product, so there would be no more excuses, however I don't think core devs are interested in getting a proper mouse support working in tmux.

Re: Tmux for Mere Mortals

#148
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…

Yes, the mouse situation in tmux is catastrophic. As much as I love tmux, I wonder what would it take that the program respects the usual copy-paste conventions like all the rest of X programs. You need to do two things, that are apparently impossible when tmux has "mouse enabled": 1. select some text in your xterm so that it gets copied 2. middle click on the xterm and your copied text (possibly from other window, w…

With my config a normal highlight interacts with tmux and if I hold shift it interacts with my terminal emulator. I'm using Termite, but I swear it worked the same in others like terminator and urxvt as well. I have both a local and remote tmux session and am basically exclusively using shells in tmux, so I've long since gotten used to in. This must be fairly standard, because a friend of mine uses Hexchat on Windows where a normal highlight can grab a line from IRC, but without the timestamp. Holding shift lets you grab all the actual text, timestamp included.

Re: Tmux for Mere Mortals

#149
post #132

All I use tmux for is to reattach to sessions after a connection drops. The rest I just configure away as much as possible, but not quite as much as I want. Is there any simpler utility that only provides persistent sessions?

GNU screen?

As far as I can tell, screen also has its own mandatory terminal emulation, which is the only remaining tmux annoyance that I haven't configured away.

Re: Tmux for Mere Mortals

#150
post #37
post #18

Earlier quoted context omitted.

> realizing it was never going to work how I liked. > You can't have it all with the mouse no matter your settings > so I went back to just using the cursor to move things around. These tools (vim, tmux, etc.) work great for mouseless setups. If you can get comfortable with a 100% keyboard control paradigm, it might work for you. I realize this might not be what you want, but if the statement "spend less time moving…

My biggest problem with "mouseless tmux" was copy-paste. How do you deal with that?

shameless plug: I wrote a tool to copy text from tmux on remote host to local OS, this is often needed when you ssh into remote host, and want to copy large amount of text (e.g. more than one screen) to local OS

https://github.com/hujun-open/rclip

Post reply on HN