[Top][All Lists]

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

Script knowing if in screen / screen window correponding to tty

From: Buddy Burden
Subject: Script knowing if in screen / screen window correponding to tty
Date: Fri, 09 Jul 2004 12:16:43 -0400
User-agent: Mozilla Thunderbird 0.6 (X11/20040701)


Been using screen for many years now and find it indispensible. I have two minor questions (let me know if you think I should have broken this up into two separate posts).

1) Is there a way for a script to tell whether it's running inside screen? I have a script that really should be run inside screen. I don't want to just fire up a screen automatically, because the person might already be running it. But the person forgets a lot too, so it would be nice to be able to flash a reminder to them, e.g. "Not running inside screen; continue anyway?". Is this possible?

2) Is there any way to know what screen window corresponds to a given tty? I generally have so many screen windows open that it's easy for me to lose track of what's where. I often find that when I vi a file, it tells me I'm already vi'ing it somewhere else. It gives me a pid, and from that I can get a tty, but I don't know where to go from there. (I'm not necessarily looking for an automated solution to this one.) If this _is_ possible, then I further wonder if there's a way to get the tty printed on the windowlist--that would be particularly nifty.

TIA for any help.

                -- Buddy

reply via email to

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