You are not logged in.

#1 2009-01-16 16:03:20

seenxu
Member
Registered: 2008-08-25
Posts: 111

[solved]Why every new urvxt window will start a new bash process, too?

For example, I had opened 5 urxvt window, each of them attatched to a single bash process, that means 5 urxvt processes results in 5 bash processes.

My quesetion:
Is it possible to make those urxvts share the same bash process/session(sorry, I don't know how to exactly describe it)? if the answer is NO. is it possible with other SHELL, like zsh?

thx a lot.

Last edited by seenxu (2009-01-17 20:08:01)

Offline

#2 2009-01-16 16:15:15

bender02
Member
From: UK
Registered: 2007-02-04
Posts: 1,328

Re: [solved]Why every new urvxt window will start a new bash process, too?

afaik it's not possible with any shell. [i think that if they'd be using the same bash process, there'd be showing exactly the same contents, like seeing the same program on three tellys next to each other.]

by the way, they might be 5 bash processes, but they'll still be using much less memory than 5*(resources for 1 bash), since they share almost everything.

Offline

#3 2009-01-16 23:33:26

heleos
Member
From: Maine, USA
Registered: 2007-04-24
Posts: 678

Re: [solved]Why every new urvxt window will start a new bash process, too?

take a look at urxvtd/urxvtc?

Offline

#4 2009-01-16 23:53:41

Procyon
Member
Registered: 2008-05-07
Posts: 1,819

Re: [solved]Why every new urvxt window will start a new bash process, too?

You can use screen -x to connect to an existing screen session.

You can also use dtach for this, but it resizes the windows to the last accessing window instead of the smallest.

Offline

#5 2009-01-17 00:21:46

sand_man
Member
From: Australia
Registered: 2008-06-10
Posts: 2,164

Re: [solved]Why every new urvxt window will start a new bash process, too?

heleos wrote:

take a look at urxvtd/urxvtc?

That's what I was going to suggest.


neutral

Offline

#6 2009-01-17 00:22:39

bender02
Member
From: UK
Registered: 2007-02-04
Posts: 1,328

Re: [solved]Why every new urvxt window will start a new bash process, too?

both heleos' and procyon's suggestions are good, they reduce the number of urxvt processes running.
but you'll still get a new shell process for a new "window".

Offline

#7 2009-01-17 00:52:35

Procyon
Member
Registered: 2008-05-07
Posts: 1,819

Re: [solved]Why every new urvxt window will start a new bash process, too?

@bender02: you can use exec screen -x or urxvt -e screen -x (not had too many good experiences with the last though (like instant closing windows))

Offline

#8 2009-01-17 06:05:44

dav7
Member
From: Australia
Registered: 2008-02-08
Posts: 674

Re: [solved]Why every new urvxt window will start a new bash process, too?

The terminal emulator and the shell are two different programs. A terminal emulator is just a program that interprets escape sequences and text going in and out. It's the responsibility of another program to handle or control what that text actually consists of; this is usually a shell.


Windows was made for looking at success from a distance through a wall of oversimplicity. Linux removes the wall, so you can just walk up to success and make it your own.
--
Reinventing the wheel is fun. You get to redefine pi.

Offline

#9 2009-01-17 08:33:59

bender02
Member
From: UK
Registered: 2007-02-04
Posts: 1,328

Re: [solved]Why every new urvxt window will start a new bash process, too?

@procyon: sure, but then you'll see the same shell session in each window wink and i don't think that that's what OP wanted.

Offline

#10 2009-01-17 13:22:42

seenxu
Member
Registered: 2008-08-25
Posts: 111

Re: [solved]Why every new urvxt window will start a new bash process, too?

Thx for your guys to suggest urxvtc/urxvtd or screen combination, which I had used for quite a long time, but what I am asking is every time launching a urxvt/urxvtc or even running screen with multiple sub-windows, they all automatically open a new bash process, if there is a way to avoid this.

you can also use "top" or "ps -e | grep -i bash" to monitor the changes, open five (urxvt/urxvtc)s and open screen with 5 sub-window, there will be at least 9 bash processes there, and sometimes even more, for example, if you use midnight commander(mc) inside one of these urxvts.

I think bender02's answer is the one to explain the problem.

Offline

#11 2009-01-17 13:50:31

seenxu
Member
Registered: 2008-08-25
Posts: 111

Re: [solved]Why every new urvxt window will start a new bash process, too?

Procyon wrote:

@bender02: you can use exec screen -x or urxvt -e screen -x (not had too many good experiences with the last though (like instant closing windows))

screen -x is nice, but just like I said each sub-windows in screen still open a new bash process. and screen sucks if you want scroll back the output history while switching between each these sub-windows, they will just messed up, this is one of the biggest reason why I always avoid using screen locally. (remote connection to use screen is an exception. big_smile).

Offline

#12 2009-01-17 14:47:43

Procyon
Member
Registered: 2008-05-07
Posts: 1,819

Re: [solved]Why every new urvxt window will start a new bash process, too?

seenxu wrote:

each sub-windows in screen still open a new bash process.

There is nothing to avoid that.
Maybe if bash would employ the urxvt method and have a bashd with bashcs as threads.

seenxu wrote:

screen sucks if you want scroll back the output history while switching between each these sub-windows, they will just messed up

Screen has copy/scrollback mode for that.
C-a [
C-a C-[
C-a esc

Offline

#13 2009-01-17 20:02:42

seenxu
Member
Registered: 2008-08-25
Posts: 111

Re: [solved]Why every new urvxt window will start a new bash process, too?

There is nothing to avoid that.
Maybe if bash would employ the urxvt method and have a bashd with bashcs as threads.

the bashd thing is great, but for now my question is clear.

thx for all your guys!


Screen has copy/scrollback mode for that.
C-a [
C-a C-[
C-a esc

Thx a lot, I will have a look at thoes keybindings.

Last edited by seenxu (2009-01-17 20:06:38)

Offline

#14 2009-04-17 11:33:47

gav616
Member
Registered: 2008-01-16
Posts: 182

Re: [solved]Why every new urvxt window will start a new bash process, too?

im sure the last update of urxvt or bash didn't make it open a bash every-time, can anyone confirm this is a new thing??


also, i used to have to 'urxvt -e bash -c "stupid command"' to manually run bash.

Last edited by gav616 (2009-04-17 11:36:43)

Offline

#15 2009-04-17 19:54:35

Dieter@be
Forum Fellow
From: Belgium
Registered: 2006-11-05
Posts: 2,001
Website

Re: [solved]Why every new urvxt window will start a new bash process, too?

seenxu wrote:

Is it possible to make those urxvts share the same bash process/session(sorry, I don't know how to exactly describe it)?

What is your goal? having 5 different windows with exactly the same contents (all the same bash session) ?

Why you would want that is beyond me.


< Daenyth> and he works prolifically
4 8 15 16 23 42

Offline

#16 2009-04-17 20:27:29

Mr.Elendig
#archlinux@freenode channel op
From: The intertubes
Registered: 2004-11-07
Posts: 4,092

Re: [solved]Why every new urvxt window will start a new bash process, too?

There is a daemon/client type shell, can't remember the name, but it is slower and eats more resources than spawning separate bash shells. (there is some other issues with it too.)


Evil #archlinux@libera.chat channel op and general support dude.
. files on github, Screenshots, Random pics and the rest

Offline

Board footer

Powered by FluxBB