News for hackers. Stuff that matters.
Re:Zellij – A Terminal Workspace and Multiplexer by qwerty456127 on Thursday April 22, 2021 @09:58AM (#26902787)
What's the point of fitting multiple terminals in a single text-mode screen when everybody is using GUI terminal emulators and tiling window managers?

I remember good old pure text-mode days with warmth but doubt there are many people actually doing it nowadays. So I imagine this (thesubject) is going to be ran inside a GUI terminal emulator window and I don't understand how is that better than just having more windows.

Re:Zellij – A Terminal Workspace and Multiplexer by eschneider on Thursday April 22, 2021 @10:48AM (#26903379)
I do most of my work (embedded development) ssh'd into a few linux boxen at the office which can reach my test devices and various other bits and bobs.

I'm pretty happy running full text mode editing in emacs (-nw, ftw :) and a few other shells for tasks I haven't incorporated into emacs yet. Speed is nice, even over a vpn, which running anything graphical is somewhat grim.

Still, the killer feature with screen multiplexers (in my case, tmux, but this isn't unique to tmux) for me is the fact that the tools preserve state, so I can start a long job and it won't be interrupted, even if the connection drops. I just log back in and reattach and everything is just like it was.

Sure there are other ways to do that, but having it neatly wrapped up and always on is really a game-changer for me.

Re:Zellij – A Terminal Workspace and Multiplexer by kleiba on Thursday April 22, 2021 @12:17PM (#26904512)
emacs -nw and screen is all you need.
Re:Zellij – A Terminal Workspace and Multiplexer by stjohnswarts on Friday April 23, 2021 @01:14AM (#26911193)
*if you like using emacs.
Re:Zellij – A Terminal Workspace and Multiplexer by otachack on Thursday April 22, 2021 @10:05AM (#26902885)
That's a good question and I think it depends on the developer. One recent day I became fed up managing my three separate terminal windows with each having a few tabs. I thought "alright, now's a great time to jump into a multiplexer" and it worked well as a catalyst. I downloaded Tmux, set a Tmux shortcut browser window for easy reference, and mimicked my setup in Tmux.

It's immensely a cleaner solution than toying around with separate windows for me. Switching sessions and consoles is seamless and it's all in one window. Eventually something will bite me regarding Tmux getting in the way of something and causing headaches but the momentum I have is great.

I suggest trying one out sometime, it may open a whole new world of tooling for you! Otherwise there's no sweat if you got something working sans multiplexer.

Re:Zellij – A Terminal Workspace and Multiplexer by mcjiggerlog on Thursday April 22, 2021 @10:12AM (#26902972)
Anecdata:

I don't want to tile all my windows, only terminals, so I'm not interested in tiling WM.

I also jump between OSs and appreciate being able to have the same terminal multiplexing behaviour on both linux and macOS, without needing to learn the keyboard shortcuts and idiosyncrasies of two different GUI terminal multiplexers.

As another commenter pointed out, being able to multiplex in the exact same way for remote sessions is a massive bonus.

Lastly, tmux has a lot of features and customization and once you learn those you really come to appreciate them. Tmux can also look really quite nice, it doesn't need to look as boring as it does out of the box: https://i.imgur.com/MgUx0U2.png.

Re:Zellij – A Terminal Workspace and Multiplexer by avtar on Thursday April 22, 2021 @10:02PM (#26910288)
If that's a screenshot of your setup do you mind sharing your config? :)
Re:Zellij – A Terminal Workspace and Multiplexer by _jal on Thursday April 22, 2021 @10:47AM (#26903362)
> but doubt there are many people actually doing it nowadays

I use tmux almost as much as bash. And if you use a Mac with Iterm2, you can use tmux the way you're imagining.

The primary advantage is the same reason I still use vim a lot - speed and efficiency. There is just no comparison to GUI tooling. But I readily admit a lot of it is familiarity - I know and like my tools, and there's no advantage gained by changing.

Re:Zellij – A Terminal Workspace and Multiplexer by bennyp101 on Thursday April 22, 2021 @10:12AM (#26902971)
I use a tiling window manager and use tmux - just because I can tile windows doesn't negate my use of tmux.

I have a single window that is all of my terminals - which to me is much easier to manage than a load of random terminals all over the place. Sessions are named, and windows are named, and I have F1-F8 mapped to load the corresponding window, F10 brings up a list of sessions, and F9 toggles between the last 2 sessions.

Mine is based on https://github.com/gpakosz/.tmux but customised for F keys, status bar, mouse etc

Re:Zellij – A Terminal Workspace and Multiplexer by dljsjr on Thursday April 22, 2021 @10:04AM (#26902871)
Remote sessions. Unless you want to use X forwarding, or create multiple SSH sessions, it's way more ergonomic to do it this way. I currently use tmux for this and when you combine it w/ the tmux command mode (-CC) and iTerm 2 you get the best of both worlds, but even without iTerm 2 integration I still prefer panes to be handled by the multiplexer because then I know I can get my consistent and comfortable environment on any arbitrary remote box.
Re:Zellij – A Terminal Workspace and Multiplexer by nitnelave on Thursday April 22, 2021 @10:12AM (#26902973)
You can multiplex your SSH session and have several ssh commands running on the same connection (without having to type the password/check the security key again). Check the ControlMaster option for SSH.
Re:Zellij – A Terminal Workspace and Multiplexer by whimsicalism on Thursday April 22, 2021 @11:28AM (#26903838)
And this is better than tmux... Why?
Re:Zellij – A Terminal Workspace and Multiplexer by _jal on Thursday April 22, 2021 @01:59PM (#26905783)
I use both. The primary reason for ControlMaster in my case is we use 2FA, and this way I only have to auth one connection.

Tmux is the UI for switching between ssh sessions sharing the connection.

Re:Zellij – A Terminal Workspace and Multiplexer by _pmf_ on Thursday April 22, 2021 @10:04AM (#26902870)
I'm a heavy terminal user, and I cannot understand how people use something like tmux that constantly causes full screen refreshes and hangs due to one part misbehaving.
Re:Zellij – A Terminal Workspace and Multiplexer by Pawka on Thursday April 22, 2021 @12:33PM (#26904715)
Are you saying that tmux feels slow on the terminal? If that is the case maybe using different terminal might help. I'm fan of `st` terminal because of its speed. And haven't noticed any slowness of tmux.
Re:Zellij – A Terminal Workspace and Multiplexer by doix on Thursday April 22, 2021 @10:13AM (#26902986)
I use tmux/screen when I am working via SSH for some reason. It's nicer to create the layout in a terminal multiplexer rather than having multiple SSH sessions, because if you ever lose connection or your laptop dies, everything is like you left it.

Locally, I don't bother and just use i3.

Re:Zellij – A Terminal Workspace and Multiplexer by 002445 on Thursday April 22, 2021 @10:19AM (#26903046)
I use tmux locally even though I run i3 as my window manager. Mostly because I configured tmux to show the current directory and git branch (if in a git directory) so I can keep my prompt a clean "$".
Re:Zellij – A Terminal Workspace and Multiplexer by earthboundkid on Thursday April 22, 2021 @11:06AM (#26903585)
My trick is all the directory, date, git junk in my prompt is separated by a newline and then $, so when I copy and paste my shell somewhere, I can just drop those lines easily without having to do fine selection.
Re:Zellij – A Terminal Workspace and Multiplexer by 002445 on Thursday April 22, 2021 @12:28PM (#26904657)
That seems like a lot of wasted space to me. The benefit of putting it into tmux is it only shows in 1 place. I don't need to see the git branch and folder of the location where I ran my previous commands, I just need to see where I am at right now.
Re:Zellij – A Terminal Workspace and Multiplexer by earthboundkid on Friday April 23, 2021 @09:23AM (#26914489)
Seeing the old time is useful though because it lets you eyeball how long a command took to run even if you forgot to do `time`.
Re:Zellij – A Terminal Workspace and Multiplexer by 002445 on Friday April 23, 2021 @03:41PM (#26918376)
Do you ever need to know how long a command takes? And if you ever need it is it really worth a full line for every command that is ran. And it shows the time that the prompt is printed right? It doesn't show the time your command is executed if I am correct.

I guess you can hit enter before every command is entered to get the correct time but that is a lot of wasted space!

Maybe I'm getting too minimalist but I don't see the benefit to productivity in these over the top prompts.

Re:Zellij – A Terminal Workspace and Multiplexer by davemp on Thursday April 22, 2021 @09:12PM (#26910006)
Not knocking your setup but you can have can configure most terminal emulators to put that info in the title and have that displayed on your bar.
Re:Zellij – A Terminal Workspace and Multiplexer by 002445 on Friday April 23, 2021 @12:02AM (#26910854)
I use i3 and the Simple Terminal (ST) so no titles and no bars for me.

If anyone is curious what it looks like: https://imgur.com/Xx19sFn.png

Re:Zellij – A Terminal Workspace and Multiplexer by tyingq on Thursday April 22, 2021 @10:06AM (#26902900)
Not having to touch the mouse. I can't do it myself, but I've watched ops folks using tmux in a productive way that I think would be difficult to reproduce if you involved a window manager.
Re:Zellij – A Terminal Workspace and Multiplexer by busterarm on Thursday April 22, 2021 @10:11AM (#26902969)
You don't have to use the mouse with tiling window managers...

/s heavy tmux user that left it for xmonad.

Re:Zellij – A Terminal Workspace and Multiplexer by alex_smart on Thursday April 22, 2021 @12:50PM (#26904933)
Can you select and copy some text from your terminal emulator without using tmux? Copy-mode is one of the killer features of tmux for me.

The only terminal emulator that supports selection with keyboard afaik is rxvt with plugins. I would be interested to know if there are other terminals that support this. Please don't say emacs XD

Re:Zellij – A Terminal Workspace and Multiplexer by busterarm on Thursday April 22, 2021 @01:26PM (#26905362)
You can use any terminal emulator you want with tiling window managers...I don't see the issue.

Run rxvt if you like.

Re:Zellij – A Terminal Workspace and Multiplexer by ibraheemdev on Thursday April 22, 2021 @10:14AM (#26902998)
Yeah, I think that the main benefit of tmux is session management. Tiling window managers can replace tmux panes.
Re:Zellij – A Terminal Workspace and Multiplexer by alpaca128 on Thursday April 22, 2021 @12:35PM (#26904734)
Tiling window managers cannot replace a multiplexer's knowledge about the session.

I use a multiplexer because it lets me instantly open a new terminal in the same directory I'm currently working in. Furthermore it can open the terminal's buffer in Vim, letting me select and copy text using all features and shortcuts I'm used to. Doing the same by scrolling around, selecting snippets using the mouse and pressing Ctrl-Shift-C cannot compete with that.

Yes, there are a few terminal emulators with integrated tabs and window splitting and all that which offer similar features, but then they also have countless other things I don't need and in return take ten times longer to open a new window.

Re:Zellij – A Terminal Workspace and Multiplexer by ibraheemdev on Thursday April 22, 2021 @01:59PM (#26905789)
> I use a multiplexer because it lets me instantly open a new terminal in the same directory I'm currently working in.

You can add a keybinding for this with alacritty:

    { key: N, mods: Command, action: SpawnNewInstance }
> Furthermore it can open the terminal's buffer in Vim, letting me select and copy text using all features and shortcuts I'm used to

alacritty has vi mode which gives you all of those keybindings without having to open vim (ctrl+shift+space).

Re:Zellij – A Terminal Workspace and Multiplexer by alpaca128 on Thursday April 22, 2021 @03:04PM (#26906773)
> alacritty has vi mode which gives you all of those keybindings

It doesn't give me access to my custom keybindings or the plugins I have setup in Vim. Also I can't select or annotate terminal output and then save it directly into a file in one step.

The multiplexer is both more powerful and flexible by actually doing less and just passing tasks like selection and copying to other proven tools. I appreciate that more than terminals trying to do everything.

Re:Zellij – A Terminal Workspace and Multiplexer by ibraheemdev on Thursday April 22, 2021 @03:30PM (#26907094)
Well, I'm not sure why you need vim plugins for copy-pasting from the terminal, but I agree that it is more powerful. My point is that a lot of people don't need tmux/zellij because their terminal emulators provide much of the useful functionality.
Re:Zellij – A Terminal Workspace and Multiplexer by busterarm on Thursday April 22, 2021 @10:22AM (#26903076)
Aye. Occasionally I'll pop tmux open in a tile for this purpose.

It's been reduced to merely being a replacement for screen for me.

Re:Zellij – A Terminal Workspace and Multiplexer by stjohnswarts on Friday April 23, 2021 @01:13AM (#26911190)
I don't know a single developer that actually stuck with tiling window managers. I know a ton who use kitty or tmux in their terminal of choice.
Re:Zellij – A Terminal Workspace and Multiplexer by jacobsenscott on Thursday April 22, 2021 @01:22PM (#26905311)
gui terminals crash. tmux is forever.
Re:Zellij – A Terminal Workspace and Multiplexer by cmrdporcupine on Thursday April 22, 2021 @12:12PM (#26904449)
About 90% of my work is remote sessions.