Discussion:
putty or ssh, screen $cmd
(too old to reply)
Helmut Schneider
2011-05-27 18:54:11 UTC
Permalink
Hi,

I'd like to supply a command to screen. Unfortunatly when using putty
or ssh nothing seems to happen:

[***@OBSDHelmut ~]$ screen ls -la
[screen is terminating]
[***@OBSDHelmut ~]$

[***@BSDHelmut ~]$ ssh -t obsdhelmut screen ls -la
Enter passphrase for key '/home/helmut/.ssh/id_dsa':
[screen is terminating]
Connection to obsdhelmut closed.
[***@BSDHelmut ~]$

When doing this on a console it works fine. Doing the same on FreeBSD
or Linux using putty or ssh also works fine.

Any setting I need to provide e.g. at /etc/screenrc?

[***@OBSDHelmut ~]$ uname -rs
OpenBSD 4.9
[***@OBSDHelmut ~]$ screen -v
Screen version 4.00.03 (FAU) 23-Oct-06
[***@OBSDHelmut ~]$

Thanks, Helmut
Nick Holland
2011-05-28 02:27:59 UTC
Permalink
Post by Helmut Schneider
Hi,
I'd like to supply a command to screen. Unfortunatly when using putty
screen? screen? I dimly recall a program called screen. Archaic piece
of sh**, as I recall.
Post by Helmut Schneider
[screen is terminating]
[screen is terminating]
Connection to obsdhelmut closed.
When doing this on a console it works fine.
dunno what "works fine" means, but today, we use a program called
"tmux", which is part of base OpenBSD.

***@fluffy.in.nickh.org
/home/nick $ ssh backup "tmux -c 'ls -la /'"
***@backup's password:
total 65500
drwxr-xr-x 17 root wheel 512 May 23 20:14 .
drwxr-xr-x 17 root wheel 512 May 23 20:14 ..
-rw-r--r-- 1 root wheel 578 Feb 28 2009 .cshrc
-rw-r--r-- 1 root wheel 468 May 23 20:14 .profile
drwxr-xr-x 2 root wheel 512 Mar 2 08:51 altroot
drwxr-xr-x 2 root wheel 1024 Mar 2 08:53 bin
...

Seems to do something more than you show. Not sure what you are trying
to accomplish, and since you didn't explain, I'm not going to worry
about it. :) Whatever you wish to do with screen, you can probably
accomplish with tmux...most likely better, and if you can't figure out
how to make it dance as you want, as it is part of OpenBSD, ask right here.

http://www.openbsd.org/faq/faq7.html#tmux
man tmux

Introduce your Linux and other BSD users to tmux, they'll love it, other
than the ones that love screen only because it hasn't changed in
years... (several of my coworkers are absolutely going ga-ga over tmux
and now pushing it more obnoxiously than me).

Nick.
Hugo Villeneuve
2011-05-28 03:15:14 UTC
Permalink
Post by Nick Holland
Post by Helmut Schneider
Hi,
I'd like to supply a command to screen. Unfortunatly when using putty
screen? screen? I dimly recall a program called screen. Archaic piece
of sh**, as I recall.
http://www.openbsd.org/faq/faq7.html#tmux
man tmux
Has tmux been fixed to work on < 150 MHz computers since it has
moved to libevent?

It was so bad I would compile a pre-libevent version on those
computers.

(Will need to check. It was probably more a libevent issue than tmux.)

Just saying that at least, screen has been working for decades
properly. Even if it was archaic. But it's not like tty are anything
new themselves (the 8bit version ones).
Theo de Raadt
2011-05-28 03:45:12 UTC
Permalink
Post by Hugo Villeneuve
Just saying that at least, screen has been working for decades
properly. Even if it was archaic. But it's not like tty are anything
new themselves (the 8bit version ones).
Go read the source code some time.

bye bye.
Ted Unangst
2011-05-28 04:45:14 UTC
Permalink
On Fri, May 27, 2011 at 11:15 PM, Hugo Villeneuve
Post by Hugo Villeneuve
Has tmux been fixed to work on < 150 MHz computers since it has
moved to libevent?
Has anyone reported what doesn't work?
g***@orange.fr
2011-05-28 08:54:49 UTC
Permalink
Post by Hugo Villeneuve
Just saying that at least, screen has been working for decades
properly. Even if it was archaic. But it's not like tty are anything
new themselves (the 8bit version ones).
If you try screen on some machines, you will crash so badly
that even DDB inside the kernel is frozen after displaying
one or two lines of panic. At first, you wonder. Then you try
tmux, and it no longer crashes. And last, you go see the
screen sources, and it's like being Nicky Larson getting
a 10-ton hammer hit on the head...
--
Gilbert Fernandes
David Vasek
2011-05-28 09:14:09 UTC
Permalink
Post by g***@orange.fr
If you try screen on some machines, you will crash so badly
that even DDB inside the kernel is frozen after displaying
one or two lines of panic. At first, you wonder. Then you try
tmux, and it no longer crashes.
Never blame an application for OS crashes, btw.

Regards,
David
Ted Unangst
2011-05-28 16:57:32 UTC
Permalink
No program, no matter how poorly written, can crash a correctly written
kernel.
Post by g***@orange.fr
Post by Hugo Villeneuve
Just saying that at least, screen has been working for decades
properly. Even if it was archaic. But it's not like tty are anything
new themselves (the 8bit version ones).
If you try screen on some machines, you will crash so badly
that even DDB inside the kernel is frozen after displaying
one or two lines of panic. At first, you wonder. Then you try
tmux, and it no longer crashes. And last, you go see the
screen sources, and it's like being Nicky Larson getting
a 10-ton hammer hit on the head...
--
Gilbert Fernandes
Miod Vallat
2011-05-28 10:16:06 UTC
Permalink
Post by Hugo Villeneuve
Has tmux been fixed to work on < 150 MHz computers since it has
moved to libevent?
Define `fixed'. What do you consider broken?

I use tmux daily on 2-digit MHz machines, but then I don't use the
status bar because I have no use for it.

Miod
Martin Pelikan
2011-05-29 23:46:42 UTC
Permalink
Post by Hugo Villeneuve
Just saying that at least, screen has been working for decades
properly. Even if it was archaic. But it's not like tty are anything
new themselves (the 8bit version ones).
Have you ever tried to use screen inside a screen? ssh'd to other
machines? Not to mention ^A is beginning-of-line in most terminals.
And the screen's window management! What a pleasure!
And the way screen reports its messages! Still a mystery to me.
tmux ftw :-)

--
Martin Pelikan
Abel Abraham Camarillo Ojeda
2011-05-29 23:54:07 UTC
Permalink
On Sun, May 29, 2011 at 6:46 PM, Martin Pelikan
Post by Martin Pelikan
Have you ever tried to use screen inside a screen? ssh'd to other
machines? B Not to mention ^A is beginning-of-line in most terminals.
I generally map ^a to be the prefix key on tmux...
Nick Holland
2011-05-30 02:31:19 UTC
Permalink
On 05/27/11 23:14, Hugo Villeneuve wrote:
...
Post by Hugo Villeneuve
Has tmux been fixed to work on < 150 MHz computers since it has
moved to libevent?
Have you stopped beating your wife and kids? [ ] yes [ ] no

Anyway... tmux seems to work just fine on a well-under 150MHz system here.

OpenBSD 4.9-current (GENERIC) #3: Mon May 23 21:40:58 MDT 2011
***@i386.openbsd.org:/usr/src/sys/arch/i386/compile/GENERIC
cpu0: Intel 486DX2 ("GenuineIntel" 486-class)
cpu0: FPU,V86
real mem = 66646016 (63MB)
avail mem = 54743040 (52MB)
mainbus0 at root
bios0 at mainbus0: AT/286+ BIOS, date 09/15/94
...

(that's probably a 66MHz proc)

So, IF there was a problem...I don't see it as-reported on -current.

Nick.
Amit Kulkarni
2011-05-30 04:09:16 UTC
Permalink
Post by Nick Holland
OpenBSD 4.9-current (GENERIC) #3: Mon May 23 21:40:58 MDT 2011
cpu0: Intel 486DX2 ("GenuineIntel" 486-class)
cpu0: FPU,V86
real mem = 66646016 (63MB)
avail mem = 54743040 (52MB)
mainbus0 at root
bios0 at mainbus0: AT/286+ BIOS, date 09/15/94
...
(that's probably a 66MHz proc)
True up and down scalability :-) 66Mhz vs 6.6Ghz (on a future IBM
Power 8/Power 9/Power 10 machine)

I am joking of course

g***@orange.fr
2011-05-28 08:52:48 UTC
Permalink
Post by Nick Holland
dunno what "works fine" means, but today, we use a program called
"tmux", which is part of base OpenBSD.
And tmux seems better written. On the Yeeloong, using
screen will send you in a kernel failure with a Trap 4
error, while using tmux you can do anything you want,
it's rock stable. screen has some shitty code inside
that overflows my fb and miod even tried to fix it
but it keeps crashing. moved to tmux, all problems gone.

Using tmux as suggested is a very good idea. First,
it's in the base system install, and second, there is
some shitty code in screen that does really bad things
to some consoles that just go nuts.

If you like to use Control-A in tmux like in screen,
create a .tmux.conf file in your home folder and
put the following inside of it :

set-option -g prefix C-a
bind-key C-a last-window
unbind C-b
set -g base-index 1
setw -g aggressive-resize on
bind-key -n F10 prev
bind-key -n F11 next
set-window-option -g mode-keys vi
set-window-option -g utf8 on

To copy/paste : Control-A to enter copy mode
(upper right a thing between [] appears) and
go to beginning of text to copy. Press space
bar once. Move to end of stuff to copy, press
Enter and it's done (sometimes you don't get a
visual feedback because of the console, don't
care). Use Control-a ] to paste as usual.

This config file uses Control-a instead of
Control-b, you can press Control-a twice to get
between the two last consoles (as screen does).
I use F10 and F11 keys to move to previous/
next console, you can remove those lines or change
them if you want to use other keys

Ditch screen. Use tmux.
--
Gilbert Fernandes
Miod Vallat
2011-05-28 10:17:54 UTC
Permalink
Post by g***@orange.fr
And tmux seems better written. On the Yeeloong, using
screen will send you in a kernel failure with a Trap 4
error, while using tmux you can do anything you want,
it's rock stable. screen has some shitty code inside
that overflows my fb and miod even tried to fix it
but it keeps crashing. moved to tmux, all problems gone.
Oh give me a break. This was a driver bug, it has been fixed, and it did
not show up under tmux because tmux does not send the same terminal
escape sequences as screen. This alone does not make screen a piece of
shit.

Miod
Helmut Schneider
2011-05-28 19:53:28 UTC
Permalink
Post by Nick Holland
[Problem with screen]
[...]
Post by Nick Holland
http://www.openbsd.org/faq/faq7.html#tmux
man tmux
[...]

Thanks for all replies (also by pm), tmux indeed looks promissing.

Helmut
Continue reading on narkive:
Loading...