Live data from Hacker News

Using tmux properly

danielallendeutsch.com

171–180 of 218 posts

Re: Using tmux properly

#171
post #51

Earlier quoted context omitted.

I learned to give up making things exactly to my liking and learn to use the default key bindings. Now I can log into any machine and be 100% productive.

I consider myself a power Emacs user, I have a sizeable Emacs configuration, but when I connect to servers, I just use vi. Simpler, faster, less fuss.

Try mg :)

Edit: mg is an emacs-like editor that is even leaner than vi, has off course the same key bindings as emacs, and also shares the same openbsd roots as tmux. It is also the default editor in openbsd.

Re: Using tmux properly

#172

Earlier quoted context omitted.

I'm willing to bet many employers really don't like their employees putting personal config files on a production server...

What do they gain from me having to type "ls -lah" instead of "ll"?

What if their contracts with their customers state everything that deployed is from an audited source in order to leave no loopholes in the event of a data breach?

And if there is a serious data breach you better be able to prove that you never installed anything malicious or dodgy on there.

Re: Using tmux properly

#173
post #125

Earlier quoted context omitted.

It gets worse when you work in ops and are constantly needing to remote into servers and you regularly have tmux within a tmux within a tmux... Littering config files across the datacenter just isn't an option.

> Littering config files across the datacenter just isn't an option. Er, what about an LDAP server for user profiles and an NFS server for home directories, like the university timesharing clusters of olde? Any box you'd log into would have "your config files" (in fact, your whole home directory) on it. Or, if the LDAP part is a hassle, be a hipster and pull all the 'user profile' info from GitHub ( https://github.co…

NFS is a nightmare, for many reasons. But there are similar solutions such as `pam_mkhomedir` which can be coerced into fetching dotfiles when a user logs in, etc.

Re: Using tmux properly

#174

I'd argue that using a terminal multiplexer like tmux or screen on a production server (as this article implied) often means you are doing things wrong. It is better to set up a service (systemd or other) and configure it to start correctly rather than relying on a tmux session to manage long running processes. By going this route you get logging, auto restarting, starting on boot, monitoring etc for free.

There's difference to daemons and Kong running process. Long process might be tar up all these files, or copy all these. Things that takes 10 s of minutes to hours. Things you don't want to bomb out just cause network died. Things that are one off and variable enough it doesn't make sense to write a server for them. And of course any you don't want to be interiors part way. Like upgrade or deployment

Maybe I'm missing something, but why not nohup?

Re: Using tmux properly

#175
post #33

Yesterday I was helping a friend setting a box with no graphical session: I fired up tmux in the linux virtual terminal and then proceeded to realize without my tmux.conf I couldn't do a thing because I have always been using entirely different keybindings from the default. This is the problem with too much customization. Learning to use the default configuration may be difficult but it's probably worth the effort, f…

The problem is that you can't use emacs properly with the default Tmux configuration. To go backward a character, with C-b, you need to do it twice.

Re: Using tmux properly

#176
post #46
post #33

Yesterday I was helping a friend setting a box with no graphical session: I fired up tmux in the linux virtual terminal and then proceeded to realize without my tmux.conf I couldn't do a thing because I have always been using entirely different keybindings from the default. This is the problem with too much customization. Learning to use the default configuration may be difficult but it's probably worth the effort, f…

I 120% agree. I once lost my emacs dotfile and suddenly i was almost unable to use Emacs on my own pc. Since then, i've decided to apply as little customisation as possible to software I use, and read the documentation and learn the standard configuration instead. For some reasons nowadays it's trendy to add colors, bells and whistles to things but I've found out that learning the standard/default configuration lets…

Problems with emacs:

* some languages are not included by default * some very good extensions are not included by default also (ace-jump)

Re: Using tmux properly

#177

So this may mark me out as different, but apart from persistent remote connections, I've never really felt the need for screen/tmux. I've been trying to figure out what the fuss is about, and I still really don't understand (apart from persistence and screen sharing.) When I want multiple terminals, I just fire up another terminal window and hey presto, jobs a goodun. I have a fairly high res screen and small fonts,…

I have a small screen with my laptop so I can only fit one terminal. It's pretty handy to change terminals all the time. Also it's handy to have all the terminals I was using popup again when I'm rebooting my computer (tmux-ressurection)

Re: Using tmux properly

#178

I basically use tmux as my window manager. I only typically open two programs: a browser, and a terminal. Both are always in full-screen mode. It makes things nice and simple. No matter if I'm working on a laptop or a desktop, all my terminal windows end up in the same place and have the same settings. It's great!

Same setup with a bunch of pdf open as well. Any idea how I could stop having so many papers open? (I'm on macOS)

Re: Using tmux properly

#179

Earlier quoted context omitted.

You do one better - tmux's mouse mode allows you to scroll with your mouse wheel. Just add 'set -g mouse on' to your ~/.tmux.conf. You can configure the history size limit by setting 'set-option -g history-limit '. When you scroll the mouse wheel, tmux will enter copy mode and scroll.

The problem is, my terminal already has a concept of scrolling, and its own concept of a buffer, with its own concept of keeping unlimited contents based on available memory, etc. I've never seen a tmux setup that doesn't fail horribly when these two concepts collide (I can't cmd-f search the buffer for interesting things, I don't get a scroll bar on the right that shows me how far up the buffer I am, scroll accelera…

I disable my Terminal.app buffer. If not in tmux, can't scroll back. All scrolling and copy and pasting is done with tmux. Also use vi keybindings so I select text and copy using same keys in vim and tmux.

Re: Using tmux properly

#180
post #150
post #99

Earlier quoted context omitted.

Yeah, this is a good approach. I have memorized how to set up three settings for vim I just have to have, but I can usually do that in less than a minute.

what are those 3 settings on vim ? I assume line numbers is one of them, which are the other 2 ?

For many people, line numbers are the first thing they set up - I never understood that. I customize vim quite heavily, and have tried showing line numbers, but all they do is take up 4-5 characters of precious window width! I can see the current line in bottom right, and when I want to go to a line, I use `45gg`.

TL;DR people are different.

Post reply on HN