Unix Shell - anyone familiar with "screen" here?

This is Interesting: Free IT Magazines  
Home > Archive > Unix Shell > October 2006 > anyone familiar with "screen" here?





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author anyone familiar with "screen" here?
newbie

2006-10-23, 7:21 pm

Hi All -

Anyone uses "screen" on Linux a lot? I have a simple question.

Is there any way to display the programs that are running on the
current screen only?
For example,
on screen 1, I use "gvim" to open files a.c and b.c;
then I start a new screen 2;
on new scrren 2, I use "gvim" to open some other files c.c and d.c.

Is there a way that when I switch to screen 1, I only see a.c and b.c
(they are both in seperate gvim windows) - I don't see c.c or d.c here;
and when I switch to screen 2, I only see c.c and b.c, not a.c or b.c.

Currently, if I start screen without any parameters, all the file a.c
b.c c.c and d.c are displayed no matter which scrren session I swtich
to. If I need to use "gvim" to open a lot of files on each screen, I
just have too many gvim windows when I have more screens. In this case,
I have to open another new SSH session when I remotely work on a
server.

Thanks for any help.

Best.

Barry Margolin

2006-10-24, 1:22 am

In article <1161640600.065088.26920@e3g2000cwe.googlegroups.com>,
"newbie" <gottoomanyaccounts@gmail.com> wrote:

> Hi All -
>
> Anyone uses "screen" on Linux a lot? I have a simple question.
>
> Is there any way to display the programs that are running on the
> current screen only?
> For example,
> on screen 1, I use "gvim" to open files a.c and b.c;
> then I start a new screen 2;
> on new scrren 2, I use "gvim" to open some other files c.c and d.c.
>
> Is there a way that when I switch to screen 1, I only see a.c and b.c
> (they are both in seperate gvim windows) - I don't see c.c or d.c here;
> and when I switch to screen 2, I only see c.c and b.c, not a.c or b.c.
>
> Currently, if I start screen without any parameters, all the file a.c
> b.c c.c and d.c are displayed no matter which scrren session I swtich
> to. If I need to use "gvim" to open a lot of files on each screen, I
> just have too many gvim windows when I have more screens. In this case,
> I have to open another new SSH session when I remotely work on a
> server.


What you want is what I would expect screen to do normally. If this
isn't happening, gvim must be detecting that it's running twice within
the same screen session, and doing something special to work together.
So the issue isn't with screen, it's with gvim.

--
Barry Margolin, barmar@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***
*** PLEASE don't copy me on replies, I'll read them in the group ***
Bill Marcum

2006-10-24, 1:22 am

On 23 Oct 2006 14:56:40 -0700, newbie
<gottoomanyaccounts@gmail.com> wrote:
> Hi All -
>
> Anyone uses "screen" on Linux a lot? I have a simple question.
>
> Is there any way to display the programs that are running on the
> current screen only?
> For example,
> on screen 1, I use "gvim" to open files a.c and b.c;
> then I start a new screen 2;
> on new scrren 2, I use "gvim" to open some other files c.c and d.c.
>
> Is there a way that when I switch to screen 1, I only see a.c and b.c
> (they are both in seperate gvim windows) - I don't see c.c or d.c here;
> and when I switch to screen 2, I only see c.c and b.c, not a.c or b.c.
>

Why not use plain vim, and open each file in a new screen? Or you could
use a window manager with multiple workspaces, and make your xterm
"sticky", but I don't know if it would be possible to automatically
change to a different workspace and a different screen at the same time.


--
To lead people, you must follow behind.
-- Lao Tsu
Kaz Kylheku

2006-10-24, 1:22 am

newbie wrote:
> For example,
> on screen 1, I use "gvim" to open files a.c and b.c;
> then I start a new screen 2;
> on new scrren 2, I use "gvim" to open some other files c.c and d.c.


You are confused. Screen multiplexes multiple tty sessions to one tty.
This is useful for character-based applications (like plain vim), not
GUI applications (like gvim) which bypass screen to connect to your X
server.

Doh?

newbie

2006-10-24, 1:17 pm


Kaz Kylheku wrote:
> newbie wrote:
>
> You are confused. Screen multiplexes multiple tty sessions to one tty.
> This is useful for character-based applications (like plain vim), not
> GUI applications (like gvim) which bypass screen to connect to your X
> server.
>
> Doh?


So basically if I use GUI applications, like gvim, screen won't do much
on them, and there is no way to tell the GUI applications to follow
screen's rules?

I use gvim whenever possible, because I have some colors configured for
gui vim, while plain vim running on a color term doesn't have them.

Thanks for everyone's input.

Jason Roscoe

2006-10-24, 1:17 pm

newbie wrote:
> Hi All -
>
> Anyone uses "screen" on Linux a lot? I have a simple question.
>
> Is there any way to display the programs that are running on the
> current screen only?
> For example,
> on screen 1, I use "gvim" to open files a.c and b.c;
> then I start a new screen 2;
> on new scrren 2, I use "gvim" to open some other files c.c and d.c.
>
> Is there a way that when I switch to screen 1, I only see a.c and b.c
> (they are both in seperate gvim windows) - I don't see c.c or d.c here;
> and when I switch to screen 2, I only see c.c and b.c, not a.c or b.c.
>
> Currently, if I start screen without any parameters, all the file a.c
> b.c c.c and d.c are displayed no matter which scrren session I swtich
> to. If I need to use "gvim" to open a lot of files on each screen, I
> just have too many gvim windows when I have more screens. In this case,
> I have to open another new SSH session when I remotely work on a
> server.
>
> Thanks for any help.
>
> Best.
>


I'm not sure you are using screen for its intended use. Instead of
launching a graphical editor within screen maybe you just want a
terminal editor. Try launching 'vim -X' instead of 'gvim'. If you
aren't doing anything with X windows, maybe do '# unset DISPLAY' before
launching screen for the first time so that any new screen windows don't
inherit the $DISPLAY variable.

Sorry, but I can't help much further without more clarification of the
problem you are having.
Jason Roscoe

2006-10-24, 1:17 pm

newbie wrote:
> Hi All -
>
> Anyone uses "screen" on Linux a lot? I have a simple question.
>
> Is there any way to display the programs that are running on the
> current screen only?
> For example,
> on screen 1, I use "gvim" to open files a.c and b.c;
> then I start a new screen 2;
> on new scrren 2, I use "gvim" to open some other files c.c and d.c.
>
> Is there a way that when I switch to screen 1, I only see a.c and b.c
> (they are both in seperate gvim windows) - I don't see c.c or d.c here;
> and when I switch to screen 2, I only see c.c and b.c, not a.c or b.c.
>
> Currently, if I start screen without any parameters, all the file a.c
> b.c c.c and d.c are displayed no matter which scrren session I swtich
> to. If I need to use "gvim" to open a lot of files on each screen, I
> just have too many gvim windows when I have more screens. In this case,
> I have to open another new SSH session when I remotely work on a
> server.
>
> Thanks for any help.
>
> Best.
>


I'm not sure you are using screen for its intended use. Instead of
launching a graphical editor within screen maybe you just want a
terminal editor. Try launching 'vim -X' instead of 'gvim'. If you
aren't doing anything with X windows, maybe do '# unset DISPLAY' before
launching screen for the first time so that any new screen windows don't
inherit the $DISPLAY variable.

Sorry, but I can't help much further without more clarification of the
problem you are having.

Whoops, didn't realize there were already posts on this thread!
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com