Run a command on startup on a specific window, don't close window on programm exit

Asked by Manson Thomas

Hi,

 I'm configuring screen to open several windows, and automatically connect to some servers (key authentication).

  I've edited the byobu window configuration file (~/.byobu/windows ) to this :

screen -t NS0 1 /home/thomas/scripts/connectToServer/ns0
screen -t NS1 2 /home/thomas/scripts/connectToServer/ns1
screen -t SD1 3 /home/thomas/scripts/connectToServer/sd1
screen -t SD2 4 /home/thomas/scripts/connectToServer/sd2
screen -t DELL 5 /home/thomas/scripts/connectToServer/dell
screen -t DEV 6 /home/thomas/scripts/connectToServer/dev
screen -t CRF 7 /home/thomas/scripts/connectToServer/crf
screen -t box 8 /home/thomas/scripts/connectToServer/box
screen -t apps 9 /home/thomas/scripts/connectToServer/apps
screen -t HOME 0 shell

But if a connection happen to close, the associated window close as well.

How can I prevent this behaviour (ie windows remains open and I can see "connection lost with server...")

I've seen on this page :

http://en.gentoo-wiki.com/wiki/Screen

something that could solve my problem, but I don't understand the syntax :

screen -t mp3blaster 4 stuff "mp3blaster\015"

The window opened last is the one that is left active after screen starts up. See -p in the man pages for to change the preselected window. When the command used to open the window ends, that window closes. The above syntax for mp3blaster runs the command, but leaves the window open when the program terminates.

Can anybody explain or tell how to do that with byobu ?

Thanks !
Thomas.

Question information

Language:
English Edit question
Status:
Solved
For:
byobu Edit question
Assignee:
No assignee Edit question
Solved by:
Manson Thomas
Solved:
Last query:
Last reply:
Revision history for this message
Manson Thomas (dev-mansonthomas) said :
#1

An answer on the mailing list which is quite good :

--------- Forwarded message ----------
From: Kazuhiro YOSHIKAWA <>
Date: Sun, Nov 14, 2010 at 23:45
Subject: Re: Run a command on startup on a specific window, don't close window on programm exit
To: <email address hidden>

> But if a connection happend to close, the associated window close as well.
>
> How can I prevent this behaviour (ie windows remains open and I can see "
> connection lost with server...")

How about using 'zombie' and 'verbose on' ?

In my .screenrc

 zombie kr
 verbose on

and when ssh session closed, window remains with some message.

Connection to XXXX closed.
=== Command terminated normally (Mon Nov 15 07:35:00 2010) ===

--
Kazuhiro YOSHIKAWA <>