[wellylug] Running a command in the background which expects keyboard entry

Simon Antliff simon.antliff at gmail.com
Fri Jun 24 17:04:52 NZST 2005


I agree whole heartedly. screen is just great.

Here's some quick start help (^ means press ctrl as well as the next
character, also things are case sensitive):

screen
   start a screen session 
screen -S foo
   start a screen session called foo

(while in screen)
^a?
   show help (you need to press shift for ?)
^ad
   detach the current screen session. This will return you to
whereever you started or attached to the screen. It's still running,
just in the background.


(while detached from a screen)
type:
screen -ls
   list all the screen sessions. if you havent specified -S when you
started the screen, then they'll be named according to pid, TTY and
hostname.

screen -x <screen-name>
   reattach to a screen. This will take you back to that screen
(similar to typing fg after ^z). If you have multiple screens you need
to specify something unique about that screen name to reattach it.



Thats really the basics.
Some more advanced things:
- If you're lazy like me, you can also detach with ^a^d.
- You can attach a screen inside a screen, but once you've done so,
you might have trouble detaching. You can use ^aad to detach the inner
screen, or if you've attached a lot of screens (say, 5 of them),
^aaaaad will get you back to the 4th one.
- You can attach to multiple screens from different TTY's. This is
great, and here's an example:

Open a terminal, type screen -S foo
Open another terminal, type screen -x foo
Now start typing in either terminal... Oooo, spooky.

You can even remotely ssh into a machine and reattach to a screen.
Great for irc clients.

- ^aEsc will start copy/paste mode. Unfortunately, ctrl-pgup/pgdn is
unlikey to work, so to scroll the backbuffer up and down you enter
this mode. You can copy and paste in this mode too, altho I've never
done so.
- screen <cmd> will start a screen and execute that command, and then
quit once its finished.
- screen has a lot more functionality which I dont know about, and
really wish was available for cygwin.

Good luck!

Simon Antliff


On 6/24/05, David Antliff <dave.antliff at paradise.net.nz> wrote:
> 
> On Fri, 24 Jun 2005, David Harrison wrote:
> > I am trying to figure out if it is possible to run a command in the
> > background if this command is expecting some form of keyboard entry.
> ...
> > Does anyone know a linux command that will load the app complete with a
> > 'virtual' keyboard or a tool that allows processes expecting user input to be
> > run in the background?
> 
> Run it in 'screen' in non-daemon or foreground mode. Detach after running
> with ctrl-A D or check 'man screen' for other ways.
> 
> --
> David.
> 
> 
> --
> Wellington Linux Users Group Mailing List: wellylug at lists.wellylug.org.nz
> To Leave:  http://lists.wellylug.org.nz/mailman/listinfo/wellylug
>




More information about the wellylug mailing list