News for hackers. Stuff that matters.
Re:GNU Screen 5.0 Released by freedomben on Thursday August 29, 2024 @10:19AM (#41391098)
Looks like a few QoL improvements and bug fixes. Nothing disruptive that would normally come with a major release version.

Looks like you can set a password on it now, which is cool (though I personally like having linux perms govern access to my screen/tmux). Multiinput sounds interesting as well, though in the past that was a feature I thought I'd love to have, but once I had I never use.

I'm glad to see Screen is still getting some love :-)

I ran screen for years before finally switching to tmux around 2011, and it's impact is still heavy as my tmux config is still rocking my "make tmux controls like screen while transitioning" setup which I intended to be temporary. Ctrl+a from my cold dead fingers

Re:GNU Screen 5.0 Released by lloeki on Thursday August 29, 2024 @12:05PM (#41392257)
The one thing I hate about tmux is that it leaks env vars across instances:

    # terminal 1, start a fresh first tmux session, which magically spawns a daemon with the same env
    $ env FOO=bar tmux
    
    # terminal 2, start another tmux session, which reuses the daemon's env
    $ tmux
    $ echo $FOO
    bar
Try the same with `screen` and you're safe.

This is especially annoying when you're using, say, direnv, and project-specific env vars appear magically on an unrelated subsequent session because your first `tmux` turned out to be from a direnv-enabled directory, which polluted the global environment, which in turn pollutes every subsequent session environment as long as a session (not necessarily the original one) is alive.

Replace FOO with SOME_SECRET/ACCESS_KEY/TOKEN and you can actually accidentally expose/leak stuff or point to the wrong thing.

The unattended workaround is to have the tmux daemon spawn at login via `start-server` + enable some tmux settings like `exit-empty` plus some I can't recall regarding environment handling, but nobody does that.

Re:GNU Screen 5.0 Released by Arnavion on Thursday August 29, 2024 @01:17PM (#41393083)
You can start the server as a user session service if you have a service manager for that, like systemd, instead of needing to do it manually. For systemd specifically, tmux also supports socket activation for the server since some time ago, so you can do that to start it on-demand.
Re:GNU Screen 5.0 Released by rauhl on Thursday August 29, 2024 @02:03PM (#41393601)
> The unattended workaround is to have the tmux daemon spawn at login via `start-server` + enable some tmux settings like `exit-empty` plus some I can't recall regarding environment handling, but nobody does that.

I just have my terminal emulator spin up tmux when it starts, and I start my terminal emulator from my desktop, so it always runs in a clean environment.

Re:GNU Screen 5.0 Released by josephcsible on Thursday August 29, 2024 @11:51AM (#41392104)
> Looks like you can set a password on it now, which is cool

I wish they didn't support that. There's not actually a security boundary there since you can't just reattach to another user's session anyway, and a lot of security people make stupid rules like "if something supports a password, you always have to use one".

Re:GNU Screen 5.0 Released by aeonik on Thursday August 29, 2024 @11:08AM (#41391596)
Why did you switch to tmux? It seems to me that screen is more ubiquitous, and has more features. Having a modem is a pretty handy thing built into it.
Re:GNU Screen 5.0 Released by Jtsummers on Thursday August 29, 2024 @11:19AM (#41391707)
Not GP, but ~15 years ago tmux offered a lot better screen splitting options and a few other features that screen did not. That's why I switched. I did continue to use screen at work because it was ubiquitous, but then sysads started installing tmux as well and that was no longer an issue.

screen has improved a lot since then, but it lagged behind substantially for years.

Re:GNU Screen 5.0 Released by freedomben on Thursday August 29, 2024 @11:37AM (#41391924)
Yes, this is exactly why I switched as well.

Also a benefit was actually being able to understand and edit my conf file without having to RTFM everything. Certainly not a reason to switch by itself, but a nice plus.

Re:GNU Screen 5.0 Released by riddley on Thursday August 29, 2024 @12:04PM (#41392252)
I was a very long time screen user and tried tmux early on in its existence. It was slow and different so I bailed back to screen. Last year I tried tmux again and have switched to it full time.

One of the things I like most about it is how easy it is to extend. In the role I was in last year, I'd have several long-lasting SSH sessions to various hosts. With a very simple bash script I was able to create a prompt in tmux that I could trigger to ask me where I wanted to ssh to. If I already had a connection to that host, it would switch me to that window, if not, it would create a new one and ssh to the host.

I wanted to do that in screen for years, but it just didn't have the features to facilitate it. On top of that I was able to easily re-map all of the keybindings to be just like screen for my muscle memory.

Re:GNU Screen 5.0 Released by ho_schi on Thursday August 29, 2024 @11:20AM (#41391721)
People say tmux is more powerful. Whatever that means?

Screen seems to cover all my needs and it learning it is easy. I came for the tabs (windows), sessions, copy and paste - but the must have for everyone is the scrollback buffer. You need it! Especially since we can scroll one the plain terminal.

Re:GNU Screen 5.0 Released by mhitza on Thursday August 29, 2024 @03:31PM (#41394474)
> People say tmux is more powerful. Whatever that means?

I very rarely use screen/tmux nowadays, but as I recall tmux is a better fit for someone who wants to script their interaction. It makes it easy to send keys to other panes/windows in the session, and also to capture the content from other existing panes/windows.

Re:GNU Screen 5.0 Released by ho_schi on Thursday August 29, 2024 @04:41PM (#41395046)
Thanks. I don’t need that features but I see the use case for others.
Re:GNU Screen 5.0 Released by umbra07 on Friday August 30, 2024 @11:36PM (#41406393)
It doesn't seem like screen has plugin support - while tmux has a fairly large plugin ecosystem.
Re:GNU Screen 5.0 Released by boltzmann-brain on Thursday August 29, 2024 @11:36AM (#41391913)
> Having a modem is a pretty handy thing built into it.

in what way?

Re:GNU Screen 5.0 Released by mm0lqf on Thursday August 29, 2024 @11:57AM (#41392165)
when I worked in the embedded software industry long ago, I spent lots and lots of time connecting over serial ports to dev boards, using software like Minicom. Being able to do that in screen itself would be neat. Tmux does it.
Re:GNU Screen 5.0 Released by kevin_thibedeau on Thursday August 29, 2024 @01:52PM (#41393483)
Screen does connect to serial ports. Just open the device and append the line parameters you want to run on the port. Unlike modem dialers like Minicom, you don't have to screw around with on-hook off-hook distinctions or an intrusive TUI.
Re:GNU Screen 5.0 Released by vmladenov on Thursday August 29, 2024 @05:28PM (#41395479)
Ha, I have only ever used screen for serial comms and only learned about Minicom from this thread
Re:GNU Screen 5.0 Released by stragulus on Thursday August 29, 2024 @06:53PM (#41396183)
Exactly the other way around for me! I've been using screen since forever, and had no idea it could do that. Minicom I still know from the dialup dark ages.
Re:GNU Screen 5.0 Released by aeonik on Friday August 30, 2024 @06:32PM (#41405108)
When I worked with embedded systems, I used both, and didn't really understand the differences and nuances between them, and now I wish I did.
Re:GNU Screen 5.0 Released by radicality on Thursday August 29, 2024 @06:37PM (#41396059)
Connecting to serial devices. You can for example get a USB uart dongle, and then connect cables to some device where you have uart pins. Most recently I was doing something like that for an esp32 board, and used screen.
Re:GNU Screen 5.0 Released by extraduder_ire on Friday August 30, 2024 @11:15AM (#41401530)
Ubuntu, and probably other distros, have screen as a hard dependency for doing upgrades to new release versions on the command line (do-release-upgrade command). I encountered it again just the other day while updating to an LTS version. It's a fantastic feature to have by default, in case your ssh connection gets dropped during the upgrade or something.
Re:GNU Screen 5.0 Released by mdaniel on Thursday August 29, 2024 @10:38AM (#41391271)
> Ctrl+a from my cold dead fingers

As someone who uses `set -o emacs` I cannot possibly imagine pressing C-a C-a to go to the beginning of the line

Also, as an iTerm2 user: the integration with tmux control mode (tmux -CC) is just amazing for the way I use tmux

Re:GNU Screen 5.0 Released by bicolao on Thursday August 29, 2024 @11:37AM (#41391933)
As someone who also uses emacs, I type C-a a so often that sometimes I do the same in emacs and it leaves an extra a. It's quite rare though.
Re:GNU Screen 5.0 Released by jbaber on Friday August 30, 2024 @10:01AM (#41400829)
As a vim user, this was my attitude about ctrl-b ctrl-b for pgup because tmux uses that. But I got used to it. Like many a screen convert to tmux, I used to map to ctrl-a, but I found myself actually getting pinky/wrist pain from using just my left hand. As a non-emacs user, I'm not okay with that :P So ctrl-b forces me to use two hands.
Re:GNU Screen 5.0 Released by freedomben on Thursday August 29, 2024 @11:44AM (#41392025)
C-a C-a definitely annoyed me at first, but I got used to it and now I don't mind it at all.
Re:GNU Screen 5.0 Released by mrj on Thursday August 29, 2024 @11:09AM (#41391603)
Yeah maddening! But you can remap it. I use this in my .screenrc to make it C-f:

escape ^Ff

Re:GNU Screen 5.0 Released by Jtsummers on Thursday August 29, 2024 @11:21AM (#41391736)
C-f moves forward a character which is also useful. The easiest to type character that had the least impact I could find was to remap to C-j. Works well in both Dvorak and Qwerty layouts and that's the one emacs shortcut I use so infrequently that I can live with having to type it twice.
Re:GNU Screen 5.0 Released by qup on Thursday August 29, 2024 @02:02PM (#41393582)
C-Space here
Re:GNU Screen 5.0 Released by foobarian on Thursday August 29, 2024 @04:56PM (#41395174)
C-t for me
Re:GNU Screen 5.0 Released by stragulus on Thursday August 29, 2024 @06:48PM (#41396141)
C-o here. And C-x or C-p on a few rare nested screens in one particular screen session that I always have open. Those are identified by differently colored tabs in the hardstatus bar which is always visible.
Re:GNU Screen 5.0 Released by PeterWhittaker on Friday August 30, 2024 @08:30AM (#41400049)
That’s my default as well, worked great, except on a machine with shared sessions, a test driver machine where several of us will login as the same user: some of those people come from windows machines where ctrl-space gets mapped to ctrl-@, which is NUL.

So we had to find another prefix for those machines; fortunately, tmux can have two.

This (space->@->NUL) is mentioned in the tmux docs, tbh.

Re:GNU Screen 5.0 Released by khc on Thursday August 29, 2024 @11:32AM (#41391863)
I map mine to C^] which I find to be a good balance between easy to type and not conflicting with other tools
Re:GNU Screen 5.0 Released by sam_lowry_ on Thursday August 29, 2024 @01:28PM (#41393208)
Two hands gesture? No way!
Re:GNU Screen 5.0 Released by remram on Thursday August 29, 2024 @11:38PM (#41397535)
This is actually a very handy readline shortcut to search for a character. Useful when editing long command lines. Granted, I use Ctrl-Shift-] more often (searches backwards).
Re:GNU Screen 5.0 Released by rwmj on Thursday August 29, 2024 @05:02PM (#41395242)
I remap the screen escape key to Shift-Ctrl-^:

  escape ^^^
Re:GNU Screen 5.0 Released by kzrdude on Thursday August 29, 2024 @11:21AM (#41391734)
Truecolor finally being released is big
Re:GNU Screen 5.0 Released by thanatos519 on Thursday August 29, 2024 @12:38PM (#41392670)
I'm looking forward to trying this indeed.

I'm wondering if the use of wcwdith() will improve my luck with using UTF-8 characters in my caption and hardstatus lines. I'd like to be using nerdfonts in there but it just makes a mess.

Re:GNU Screen 5.0 Released by kevin_thibedeau on Thursday August 29, 2024 @02:03PM (#41393603)
The entire wchar_t API is hopelessly broken. It isn't guaranteed to represent Unicode nor is it guaranteed to be UTF-32. Unicode has a large number of codepoints designated as ambiguous width. This is largely due to existing narrow text presentation symbols being gifted a wide emoji representation. Which width is the default is heavily dependent on the font(s) in use and your rendering engine. Gnome VTE has a configuration option to set the default width for ambiguous codepoints.

Any program has to expect wide, narrow, or an inconsistent mixture of both if font substitutions are invoked. With no actual API to reliably discover a codepoint display width, your best option is to print some candidates and check the cursor position as a heuristic.

Re:GNU Screen 5.0 Released by int_19h on Thursday August 29, 2024 @05:08PM (#41395297)
FWIW, wchar_t is guaranteed to be Unicode if __STDC_ISO_10646__ is defined, which is the case on Linux/glibc. It's too bad that other platforms are lagging behind on this - there's really no good reason to not guarantee this in 2024. Windows at least has the excuse of having wchar_t be 16-bit which they can't change for legacy compat reasons, but that doesn't explain why e.g. FreeBSD isn't there yet.
Re:GNU Screen 5.0 Released by dolmen on Friday August 30, 2024 @04:15PM (#41404041)
This article may give you some informed answer:

https://mitchellh.com/writing/grapheme-clusters-in-terminals

Re:GNU Screen 5.0 Released by trallnag on Thursday August 29, 2024 @10:48AM (#41391360)
I wonder how many people are using the default b key binding in tmux
Re:GNU Screen 5.0 Released by entropie on Thursday August 29, 2024 @11:21AM (#41391738)
No emacs user.

I use p in screen and tmux as prefix key. I usually prefer tmux.

Re:GNU Screen 5.0 Released by sorrythanks on Thursday August 29, 2024 @11:34AM (#41391879)
Your use of p surprises me if you don't use b for emacs reasons! How do you go up a line!?
Re:GNU Screen 5.0 Released by entropie on Thursday August 29, 2024 @12:25PM (#41392509)
Iam pretty sure that was a recommendation in the emacswiki to use ^P instead of ^A as prefix key (that must be 15+ years ago). I think I didnt invest to much energy to think about an alternative. I almost never use ^P in my terminal emulator, but I use ^A all the time.

I usually never do heavy editing in a tmux window. Rarely I use emacs in a terminal window these days. I use tramp to remote connect and edit comfortably in my X session.

Re:GNU Screen 5.0 Released by setopt on Thursday August 29, 2024 @12:39PM (#41392676)
I dropped the prefix entirely: https://github.com/jabirali/tmux-tilish
Re:GNU Screen 5.0 Released by 331c8c71 on Thursday August 29, 2024 @12:44PM (#41392743)
I do.
Re:GNU Screen 5.0 Released by vindex10 on Thursday August 29, 2024 @01:29PM (#41393224)
I usually use ctrl+a locally but ctrl+b remotely, so they don't clash when nested.
Re:GNU Screen 5.0 Released by lanstin on Thursday August 29, 2024 @02:28PM (#41393867)
I use back-tick `. For nested, it becomes `` or ````. For twice nested and I'm writing a shell script with ` instead of $( .. ) It's ```````` (I'm an emacs user, I need all the control characters :)
Re:GNU Screen 5.0 Released by e-max on Thursday August 29, 2024 @06:50PM (#41396157)
I also use backticks, and in 99.9% of cases it works like a charm. But then one day you paste a large file, and the gates of hell open. Tmux randomly opens windows, kills sessions, and launches nuclear missiles while processing all the backticks in the text.
Re:GNU Screen 5.0 Released by setopt on Friday August 30, 2024 @02:45AM (#41398262)
I think this can be avoided if you enable “bracketed paste” in your terminal.
Re:GNU Screen 5.0 Released by lanstin on Friday August 30, 2024 @01:46PM (#41402938)
Yeah, that's true. Tho for large pastes, I generally only do that in a locally running GUI emacs. For remote, I'll assemble the file and then scp.

Even without tmux, this can be an issue - a long time ago I was using the X windows "drag the selection" middle mouse button action and accidentally let go of the button while the cursor was over an emacs text window - I sent my first email to some big listserv I subscribed to consisting of weird fragments from the log file I was trying to paste.a

Re:GNU Screen 5.0 Released by eikenberry on Thursday August 29, 2024 @02:55PM (#41394149)
I use the default ctrl-b for tmux and changed screen to use the same. I like it because on my keyboard, a Kinesis Advantage, the (left) ctrl and b keys are right next to each other which makes them an easy combo.
Re:GNU Screen 5.0 Released by susam on Thursday August 29, 2024 @06:45PM (#41396111)
> I wonder how many people are using the default b key binding in tmux

I do not use C-b as the tmux prefix key because it interferes with my muscle memory for Emacs where C-b invokes backward-char (i.e., move the cursor back by character(s)).

So I use C-j instead as the prefix key. While C-j also happens to be a useful Emacs key-binding, I use it quite rarely in Emacs. As a result, I do not have strong muscle memory for C-j and I can use it as the prefix key in tmux quite comfortably.

Here is my tiny .tmux.conf: https://github.com/susam/dotfiles/blob/main/.tmux.conf

Re:GNU Screen 5.0 Released by __david__ on Thursday August 29, 2024 @06:56PM (#41396207)
I use emacs so that meant practically every prefix character would annoy me at some point. I ended up using C-\ since that almost never gets used by anything (I was surprised it could even be detected by terminals).
Re:GNU Screen 5.0 Released by setopt on Friday August 30, 2024 @02:51AM (#41398283)
C-\ is one of my favorite Emacs keybindings :). You use it to change input methods, in my case to write e.g. Greek letters and other Unicode symbols in plaintext files using TeX notation.

I sometimes like to program using Unicode variable names when doing physics/math, and this is an easy way to do so built into Emacs.

Re:GNU Screen 5.0 Released by rauhl on Thursday August 29, 2024 @02:01PM (#41393573)
> Ctrl+a from my cold dead fingers

That conflicts with the standard Emacs binding to move to the beginning of the current line. Many years ago, I switched to C-z instead, on the theory that it is really easy to type C-z C-z when I really want to suspend whatever is currently running.

Pity that (AFAICT) terminals have no concept of Super and Hyper (USB doesn’t know about Hyper, either, but at least X11 does).

Re:GNU Screen 5.0 Released by MaxBarraclough on Saturday August 31, 2024 @08:12AM (#41408294)
> That conflicts with the standard Emacs binding to move to the beginning of the current line

Also in Bash.

Re:GNU Screen 5.0 Released by porksoda on Monday September 02, 2024 @08:16AM (#41424811)
Our finger memory for ^a is now ^a-a. In all apps, everywhere. Mostly that just results in something like select-all+select-all, but occasionally it's awful
Re:GNU Screen 5.0 Released by jart on Thursday August 29, 2024 @09:24PM (#41396984)
true color support is a big deal. I've been waiting for that for years.