[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Run a command on startup on a specific window, don't close window on

From: Chris
Subject: Re: Run a command on startup on a specific window, don't close window on programm exit
Date: Sun, 14 Nov 2010 21:03:13 -0500

Stuff is a screen command and the 2 lines I gave you were meant for your .screenrc file.

    Stuff is used to stuff the given string in the input buffer of the current window as if you typed it in at the prompt.

screen -t NS1                # Open a new window
stuff "~/\015"       # Call you script which ssh's to remote box.

Here is quick example.  Create the 2 files below then run screen calling the test .screenrc file.

$ cat
echo test123

$ cat .screenrctest
#caption unrelated to this example, just displays open screens at bottom of term
caption always "%{kW} %=%{.kG} %H:%{.kY}%1` %{.bW} %-w%{.rW}%f%n %t%{-}%+w %{.kG} %D %m/%d %C%a %{.Wk} %u%="
screen -t NS0
screen -t NS1
stuff "~/\015"


$ screen -c .screenrctest

On Sun, Nov 14, 2010 at 6:30 PM, Thomas Manson <address@hidden> wrote:
Hi Chris,

I don't understand the "stuff" thing in the command....

If I let it, I get  a command not found, and If I remove it, and just put "/path/to/command\015"

I get the same command not found...

Thanks for helping !

On Sun, Nov 14, 2010 at 18:06, Chris <address@hidden> wrote:
Do this:

screen -t NS0
stuff "/home/thomas/scripts/connectToServer/ns0\015"

Add the "\015" which is the octal code for a Carriage Return.

On Fri, Nov 12, 2010 at 6:43 PM, Thomas Manson <address@hidden> wrote:

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

I've edited the screen configuration file 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 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...")

Thanks !

screen-users mailing list

screen-users mailing list

reply via email to

[Prev in Thread] Current Thread [Next in Thread]