View previous topic :: View next topic |
Author |
Message |
gtwrek n00b

Joined: 10 Mar 2017 Posts: 48 Location: San Jose, CA
|
Posted: Tue Feb 25, 2020 3:22 pm Post subject: Benefits of GNU Screen/tmux vs direct terminals |
|
|
[Moderator note: this post, and the first 14 responses were originally attached to the topic What's the real reason Gentoo never got an installer?. I split them to let that thread stay on its original purpose, and not discourage discussion of terminal multiplexers. As a convenience, I edited the quote attributions in this post to link back to their origin posts. -Hu]
krinn wrote: | gtwrek wrote: | I can start it, minimize the window while it chugs away, and do other things while it works. |
screen emerge ....  |
"screen" is one of those apps that just missed my radar for far too long. I started using it just a couple of years ago, and now, can't figure out how I got by for so long without it... |
|
Back to top |
|
 |
Hu Moderator

Joined: 06 Mar 2007 Posts: 16508
|
Posted: Wed Feb 26, 2020 1:49 am Post subject: |
|
|
If you haven't yet, I suggest you also look at tmux. It is intended to serve the most commonly used purposes of screen, but has some user-visible differences that some people find desirable. (It also has the advantage of a name you can put into a search engine and have a chance of finding something relevant.) |
|
Back to top |
|
 |
CasperVector Apprentice


Joined: 03 Apr 2012 Posts: 156
|
Posted: Wed Feb 26, 2020 1:56 am Post subject: |
|
|
Hu wrote: | If you haven't yet, I suggest you also look at tmux. It is intended to serve the most commonly used purposes of screen, but has some user-visible differences that some people find desirable. (It also has the advantage of a name you can put into a search engine and have a chance of finding something relevant.) |
I furtherly recommend abduco + dvtm. Even more lightweight. _________________ My current OpenPGP key:
RSA4096/0x227E8CAAB7AA186C (expires: 2020.10.19)
7077 7781 B859 5166 AE07 0286 227E 8CAA B7AA 186C |
|
Back to top |
|
 |
gtwrek n00b

Joined: 10 Mar 2017 Posts: 48 Location: San Jose, CA
|
Posted: Wed Feb 26, 2020 4:36 pm Post subject: |
|
|
Note: thread drift...
Quote: | Hu Wrote:
If you haven't yet, I suggest you also look at tmux. |
Quote: | CasperVector Wrote:
I furtherly recommend abduco + dvtm. Even more lightweight. |
Thanks for both the recommendations. I've heard of tmux, but never looked into it. Never heard abduco nor dvtm. I'll have to look.
I'd REALLY like a screen like utility for X - what xpra is intended to be. However every time I eval xpra - it's "almost there". Stability is improving. But a basic feature, that I find I can't live without - is cut/paste transparency. I never realized how hard this could be. I use "X11" style cut/paste (i.e. left click select, middle click paste) everywhere - like multiple times an hour. And the way X11 network transparency works, this works fine over "remote" X connections. Then when I found I was using various "remove display" connections (XPRA/VNC/RDP etc) cut/paste across the "remote" link was hit and miss. Noteworthy - the Microsoft solution RDP seems to handle it best. Xpra/VNC clipboard transparency is mostly broken... |
|
Back to top |
|
 |
dmpogo Advocate

Joined: 02 Sep 2004 Posts: 2969 Location: Canada
|
Posted: Wed Feb 26, 2020 5:35 pm Post subject: |
|
|
I know about "screen" for years (hm, decades), even have it installed. But never figured out why do I need it in a multi windowed environment. |
|
Back to top |
|
 |
John R. Graham Administrator


Joined: 08 Mar 2005 Posts: 10459 Location: Somewhere over Atlanta, Georgia
|
Posted: Wed Feb 26, 2020 5:55 pm Post subject: |
|
|
So you can restart your desktop environment without halting an in-progress emerge.
- John _________________ I can confirm that I have received between 0 and 499 National Security Letters. |
|
Back to top |
|
 |
gtwrek n00b

Joined: 10 Mar 2017 Posts: 48 Location: San Jose, CA
|
Posted: Wed Feb 26, 2020 5:58 pm Post subject: |
|
|
Quote: | I know about "screen" for years (hm, decades), even have it installed. But never figured out why do I need it in a multi windowed environment. |
There's tons of use models, but the primary use case for me, is most of my work is done on headless servers. I have 7-8 gentoo "servers" at home. Some are as simple as Raspberry Pi's. Some are beefy machine that serve VMs. Some are virtual inside those VMs.
I only have 1 traditional desktop at home with a monitor, keyboard, and mouse (A gentoo box too). Bu I can connect to all my embedded servers - from home, from work, from my chromebook when sitting in front of the TV, and resume any work I was doing with screen. At home all of my "emerge" work is done in a screen session - crunching away in the background. I can let it do it's thing, and check up on it (from anywhere) when it's convenient for me. Side note, 'emerge' performance - while I keep up on the threads discussing - is mostly a don't care for me. My Pi's can take days to update. I don't care - it's number crunching in the background.
At work, same thing. All our big-iron servers are at Co-Location offsite. I connect to them from various places, and resume where I left off. |
|
Back to top |
|
 |
dmpogo Advocate

Joined: 02 Sep 2004 Posts: 2969 Location: Canada
|
Posted: Wed Feb 26, 2020 6:19 pm Post subject: |
|
|
gtwrek wrote: | Quote: | I know about "screen" for years (hm, decades), even have it installed. But never figured out why do I need it in a multi windowed environment. |
There's tons of use models, but the primary use case for me, is most of my work is done on headless servers. I have 7-8 gentoo "servers" at home. Some are as simple as Raspberry Pi's. Some are beefy machine that serve VMs. Some are virtual inside those VMs.
I only have 1 traditional desktop at home with a monitor, keyboard, and mouse (A gentoo box too). Bu I can connect to all my embedded servers - from home, from work, from my chromebook when sitting in front of the TV, and resume any work I was doing with screen. At home all of my "emerge" work is done in a screen session - crunching away in the background. I can let it do it's thing, and check up on it (from anywhere) when it's convenient for me. Side note, 'emerge' performance - while I keep up on the threads discussing - is mostly a don't care for me. My Pi's can take days to update. I don't care - it's number crunching in the background.
At work, same thing. All our big-iron servers are at Co-Location offsite. I connect to them from various places, and resume where I left off. |
Thanks for the explanation ! As I see, the main use case is if you want to monitor something running in a remote terminal from multiple locations. I rarely do that (i.e montitor output to the terminal), so
preserving the terminal output has never been much of a value, my codes usually write into files, so new ssh session to a remote machine and tailing log file for my runs usually suffice. Or on office desktop I just have 10 konsole windows opened practically permanently into different projects/remote machines. |
|
Back to top |
|
 |
Jaglover Watchman


Joined: 29 May 2005 Posts: 7799 Location: Saint Amant, Acadiana
|
Posted: Wed Feb 26, 2020 6:31 pm Post subject: |
|
|
Quote: | Or on office desktop I just have 10 konsole windows opened practically permanently into different projects/remote machines. |
Now, when anything happens to this desktop what happens to those projects if they run without screen?  _________________ My Gentoo installation notes.
Please learn how to denote units correctly! |
|
Back to top |
|
 |
dmpogo Advocate

Joined: 02 Sep 2004 Posts: 2969 Location: Canada
|
Posted: Wed Feb 26, 2020 6:50 pm Post subject: |
|
|
Jaglover wrote: | Quote: | Or on office desktop I just have 10 konsole windows opened practically permanently into different projects/remote machines. |
Now, when anything happens to this desktop what happens to those projects if they run without screen?  |
Hm, nothing, since codes if running are running in background and usually output nothing to the terminal (it is kind of considered bad practice to output to the terminal during "production:, i.e sufficiently long, run) ? |
|
Back to top |
|
 |
gtwrek n00b

Joined: 10 Mar 2017 Posts: 48 Location: San Jose, CA
|
Posted: Wed Feb 26, 2020 6:51 pm Post subject: |
|
|
Jaglover wrote: | Quote: | Or on office desktop I just have 10 konsole windows opened practically permanently into different projects/remote machines. |
Now, when anything happens to this desktop what happens to those projects if they run without screen?  |
Exactly. At work, my main machine I sit in front of is Windoze. I've no control over this - it's what my company deploys. But all my work is really on various linux servers. My desktop is a thin-client, and email/browsing machine, nothing more.
Our IT dept, pushes out monthly patches to our desktops. We can't stop them, and they can come at anytime, without warning. And since they're Windoze, all such updates require a restart. "Screen" is one of the few things that saves my sanity here. |
|
Back to top |
|
 |
dmpogo Advocate

Joined: 02 Sep 2004 Posts: 2969 Location: Canada
|
Posted: Wed Feb 26, 2020 6:53 pm Post subject: |
|
|
gtwrek wrote: | Jaglover wrote: | Quote: | Or on office desktop I just have 10 konsole windows opened practically permanently into different projects/remote machines. |
Now, when anything happens to this desktop what happens to those projects if they run without screen?  |
Exactly. At work, my main machine I sit in front of is Windoze. I've no control over this - it's what my company deploys. But all my work is really on various linux servers. My desktop is a thin-client, and email/browsing machine, nothing more.
Our IT dept, pushes out monthly patches to our desktops. We can't stop them, and they can come at anytime, without warning. And since they're Windoze, all such updates require a restart. "Screen" is one of the few things that saves my sanity here. |
Sure, I understand that, but what was so valuable worth saving in your screen sessions ? |
|
Back to top |
|
 |
gtwrek n00b

Joined: 10 Mar 2017 Posts: 48 Location: San Jose, CA
|
Posted: Wed Feb 26, 2020 6:55 pm Post subject: |
|
|
dmpogo wrote: | Jaglover wrote: | Quote: | Or on office desktop I just have 10 konsole windows opened practically permanently into different projects/remote machines. |
Now, when anything happens to this desktop what happens to those projects if they run without screen?  |
Hm, nothing, since codes if running are running in background and usually output nothing to the terminal (it is kind of considered bad practice to output to the terminal during "production:, i.e sufficiently long, run) ? |
I once took this tact as well - thinking, I can manage this myself. But properly backgrounding everything, redirecting logs, and dealing properly with SIGHUP, etc takes attention to details. Screen really just makes this incredibly easy automatically.
Ok, I've derailed the thread enough.... Leaving this alone. |
|
Back to top |
|
 |
duane Tux's lil' helper

Joined: 03 Jun 2002 Posts: 146 Location: Oklahoma City
|
Posted: Wed Feb 26, 2020 6:57 pm Post subject: |
|
|
Tmux (or screen) is especially useful if, like me, you don't run a giant desktop suite, like kde. I run openbox and xterm, and I generally have two xterm windows open with tmux in them, pretty much full time -- one local, and one remote. Konsole might be able to do the same things, but it would involve loading a bunch of extra libraries and dbus.
Since I don't use a taskbar, my tmux instances run a little script that outputs system load, temperature, frequency, free memory and local time for each system at the bottom of the xterm window. (The output is a lot smaller than it sounds, and leaves plenty of room for the tmux "window tabs".)
I was skeptical about tmux until I tried it. Now I'm hooked. |
|
Back to top |
|
 |
dmpogo Advocate

Joined: 02 Sep 2004 Posts: 2969 Location: Canada
|
Posted: Wed Feb 26, 2020 8:07 pm Post subject: |
|
|
gtwrek wrote: | dmpogo wrote: | Jaglover wrote: | Quote: | Or on office desktop I just have 10 konsole windows opened practically permanently into different projects/remote machines. |
Now, when anything happens to this desktop what happens to those projects if they run without screen?  |
Hm, nothing, since codes if running are running in background and usually output nothing to the terminal (it is kind of considered bad practice to output to the terminal during "production:, i.e sufficiently long, run) ? |
I once took this tact as well - thinking, I can manage this myself. But properly backgrounding everything, redirecting logs, and dealing properly with SIGHUP, etc takes attention to details. Screen really just makes this incredibly easy automatically.
Ok, I've derailed the thread enough.... Leaving this alone. |
yep, we went sidewise, sorry. Thanks a lot everybody ! |
|
Back to top |
|
 |
Hu Moderator

Joined: 06 Mar 2007 Posts: 16508
|
Posted: Thu Feb 27, 2020 1:56 am Post subject: |
|
|
gtwrek wrote: | Note: thread drift... | Fixed by splitting the thread. gtwrek wrote: | But a basic feature, that I find I can't live without - is cut/paste transparency. I never realized how hard this could be. I use "X11" style cut/paste (i.e. left click select, middle click paste) everywhere - like multiple times an hour. | I use xpra on a daily basis, including starting clients on different systems to relocate the displayed windows from one X server to another. I vaguely recall seeing clipboard problems several years ago, but it has been completely reliable for me for more than a year now. dmpogo wrote: | I know about "screen" for years (hm, decades), even have it installed. But never figured out why do I need it in a multi windowed environment. | I routinely use keyboard-driven copy/paste of arbitrary text from programs running in a terminal, including copying from a terminal showing ssh host1 and pasting to a terminal running ssh host2. tmux makes that easy, and I'm pretty sure GNU Screen can do that too (but I haven't run Screen in years). Through an integration with xclip, I can even move text between the X clipboard buffers and the tmux internal buffer, so I can paste from the X middle-mouse-buffer without touching my mouse at all, and I can insert from the X control-v buffer into programs which don't directly accept that (such as xterm in its default configuration, where ^V passes to the contained terminal and acts as a quoting character). |
|
Back to top |
|
 |
krinn Watchman


Joined: 02 May 2003 Posts: 7466
|
Posted: Thu Feb 27, 2020 11:13 am Post subject: |
|
|
dmpogo wrote: | Sure, I understand that, but what was so valuable worth saving in your screen sessions ? |
technically speaking, using screen with emerge "should" do nothing more than just emerge in background
but it's always better to be able to reattach to the session to see if work is sitll going or done
if emerge gets stuck (it happen to few user sometimes i saw), it will remains stuck in background forever, until you will check running process in your server and see there's still an emerge/gcc going on while it should be end by that time
with screen it's easier: it goes in background, i don't have to care its state, i come home, reattach to it, if it's done i can't (the session end), if something bad happen, i will see it
the difference is minor, but give it a try, you'll see you will love screen |
|
Back to top |
|
 |
gtwrek n00b

Joined: 10 Mar 2017 Posts: 48 Location: San Jose, CA
|
Posted: Thu Feb 27, 2020 8:40 pm Post subject: |
|
|
Hu wrote: | I use xpra on a daily basis, including starting clients on different systems to relocate the displayed windows from one X server to another. I vaguely recall seeing clipboard problems several years ago, but it has been completely reliable for me for more than a year now. |
Thanks for the info Hu (and for splitting the thread). I've tried Xpra about 4 or 5 times since I heard about it. It offers so much promise but for me was never quite there. Your experience encourages me to try it again soon.
This thread has filled my in tray for the foreseeable future for "things to look into when I get around to it..." |
|
Back to top |
|
 |
dmpogo Advocate

Joined: 02 Sep 2004 Posts: 2969 Location: Canada
|
Posted: Fri Feb 28, 2020 6:48 am Post subject: |
|
|
krinn wrote: | dmpogo wrote: | Sure, I understand that, but what was so valuable worth saving in your screen sessions ? |
technically speaking, using screen with emerge "should" do nothing more than just emerge in background
but it's always better to be able to reattach to the session to see if work is sitll going or done
if emerge gets stuck (it happen to few user sometimes i saw), it will remains stuck in background forever, until you will check running process in your server and see there's still an emerge/gcc going on while it should be end by that time
with screen it's easier: it goes in background, i don't have to care its state, i come home, reattach to it, if it's done i can't (the session end), if something bad happen, i will see it
the difference is minor, but give it a try, you'll see you will love screen |
I did try it once (not super intensively), and my problem was that I was forgetting that I am in screen session and that there are some other sessions in the same terminal window. So after some time
there were several orphaned screens that I forgot about. So I returned to 'one window - one session' workflow. Perhaps requires some practice. |
|
Back to top |
|
 |
eccerr0r Watchman

Joined: 01 Jul 2004 Posts: 7713 Location: almost Mile High in the USA
|
Posted: Sat Jul 25, 2020 2:23 am Post subject: |
|
|
I couldn't get myself to use tmux, use screen too much ever since I learned of it years ago... it's one of those critical pieces of software to me. I just wish that its split screen modes wasn't so clunky, alas it is what it is... I end up using app-misc/splitvt in screen to fix that... _________________ Intel Core i7 2700K@ 4.1GHz/HD3000 graphics/8GB DDR3/180GB SSD
What am I supposed watching? |
|
Back to top |
|
 |
gtwrek n00b

Joined: 10 Mar 2017 Posts: 48 Location: San Jose, CA
|
Posted: Sat Jul 25, 2020 3:10 am Post subject: Xpra |
|
|
Since this thread's been bumped an update on what I've tried . I gave xpra a try again - Version 3.0.2 on my main gentoo desktop. The performance is quite good; however I'm still having trouble with clipboard across sessions. It only works about 50% of the time for me. If I have time I may try and work with the developers, but to me, it's still "not quite there"...
It's eye-opening to me how complicated managing clipboards could be. I've just always relied on the X left, middle, right mouse clicks, and it always worked reliably, no matter where my X connection server is with respect to the client since, well, forever. I understand it's an entirely different concept with respect to the remote frame buffer and compositors... |
|
Back to top |
|
 |
eccerr0r Watchman

Joined: 01 Jul 2004 Posts: 7713 Location: almost Mile High in the USA
|
Posted: Sat Jul 25, 2020 4:56 am Post subject: |
|
|
Whatever happened to VNC?
Alas screen still wins in bandwidth... low bandwidth links sucks with any GUI... _________________ Intel Core i7 2700K@ 4.1GHz/HD3000 graphics/8GB DDR3/180GB SSD
What am I supposed watching? |
|
Back to top |
|
 |
Hu Moderator

Joined: 06 Mar 2007 Posts: 16508
|
Posted: Sat Jul 25, 2020 4:40 pm Post subject: |
|
|
The problem with VNC is that the VNC client displays a single X window that displays the contents of the VNC server, and all the programs connected to the VNC server are managed on the server. According to your local window manager, you have exactly one relevant window: the VNC client viewer. You can't use your local window manager to focus/move/iconify/resize remote windows, because as far as your local window manager is concerned, you are just displaying a window with a picture in it. In contrast, xpra generates one local X window for each remote X window, so your local window manager can focus/move/etc. the individually forwarded Xpra X windows. Further, because the forwarded windows have local windows, you can do complicated things like have one remote window fully visible and raised (possibly even in a layer that keeps it above other windows), while other remote windows are buried by local windows. With VNC, either your VNC client is buried or it isn't. If it is not buried, it buries every local window that overlaps it, even if you are only using it to show one relatively small remote X window that would not, on its own, require burying any local windows. You may be able to work around that by adjusting window layering in your window manager, but you may find yourself adjusting layers rather frequently to try to get the right mix of local and remote content visible. Making all the windows map to local X windows provides a much more natural flow for raising/lowering the parts you want.
gtwrek: sorry to see that xpra is still not working well for you. I continue to use it daily, and it's fine for me, so there must be something different in our environments. I am currently on 3.0.5-r1, but I had 3.0.2 for a while and I do not recall any clipboard failures with it. It does seem to lag about 0.5-1 seconds when I try to paste from one side to the other, which is annoying, but it always succeeds after the stall, which seems to be different from what you describe. Xpra logs some debug output to its starting terminal by default, and you may be able to increase verbosity to try to run down the problem. |
|
Back to top |
|
 |
eccerr0r Watchman

Joined: 01 Jul 2004 Posts: 7713 Location: almost Mile High in the USA
|
Posted: Sat Jul 25, 2020 5:23 pm Post subject: |
|
|
I've always thought that to be better that all remote windows are kept together so I don't need to micromanage which window is related to what machine... Yes it is a bother if you manage multiple machines and want to monitor different parts of each machine, though it's never been an issue for me at least, unlike keeping track of which machine each window belongs to...
Nesting connections however doesn't help...hah. _________________ Intel Core i7 2700K@ 4.1GHz/HD3000 graphics/8GB DDR3/180GB SSD
What am I supposed watching? |
|
Back to top |
|
 |
Hu Moderator

Joined: 06 Mar 2007 Posts: 16508
|
Posted: Sat Jul 25, 2020 5:27 pm Post subject: |
|
|
I usually want to see a mixture of my local and remote windows, and I like having window manager bindings able to manage remote windows without needing to execute a keyboard grab for VNC. If you want to focus on just one system, yes, having all its windows confined in a box that you maximize to fill the local screen could be a better choice. I sometimes want to use different size physical displays for viewing the same remote content, and that is easier if I always run the local X server at native resolution and float the remote windows freely as Xpra X windows. If I used VNC, then either the small display system would cut off part of the VNC client, the large display system would waste some of its visual space, or I would need to tell VNC to resize its server when I switch displays. |
|
Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|