Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.user > #211492

Re: terminal window returns prompt (was: dash/bash: exec behaviour change on Buster)

From John Crawley <john@bunsenlabs.org>
Newsgroups linux.debian.user
Subject Re: terminal window returns prompt (was: dash/bash: exec behaviour change on Buster)
Date 2019-07-18 05:40 +0200
Message-ID <yl5qV-5Dj-3@gated-at.bofh.it> (permalink)
References <ykNkl-2QL-1@gated-at.bofh.it> <ykNDH-2Xd-1@gated-at.bofh.it> <yl3yO-4ku-7@gated-at.bofh.it>
Organization BunsenLabs

Show all headers | View raw


On 2019-07-18 10:29, John Crawley wrote:
> Hi tomas and Thomas, thanks for your input.
> I think I have a basic idea of what exec does.
> However, try running in a terminal:
> echo $$
> exec <someterminal>
> #Then, in the new terminal:
> echo $$
> 
> The two PIDs are different! (or were here)
> 
> On 2019-07-17 17:37, Thomas Schmitt wrote:
>> John Crawley wrote:
>>>> In Buster, the launching dash shell dies *immediately* and the bash
>>>> prompt returns, even while the new window is still open.
>> tomas wrote:
>>> that most probably is due to a change
>>> in behaviour of "x-terminal-emulator".
>> My suspicion too. If the x-terminal-emulator puts itself into background,
>> then the starting terminal ends immediately.
> 
> The Debian alternative system is just a series of symlinks.
> /usr/bin/x-terminal-emulator points to 
> /etc/alternatives/x-terminal-emulator which in turn points to (on my 
> system) /usr/bin/urxvt.
> It's hard to imagine a stretch>buster change in behaviour, really.
> 
>> What happens if you run
>>    x-terminal-emulator
>> without "exec". Does the shell prompt come back immediately ?
> 
> No. Not on Stretch. x-terminal-emulator, or a specific terminal call, in 
> every case the prompt waits till the called window is closed.
> ---
> But... on Buster it depends on exactly what terminal it's currently 
> pointing to. I've tried a few that were on my test system and:
> 
> gnome-terminal or gnome-terminal.wrapper and lxterminal both return the 
> prompt immediately. (*.wrapper scripts are for x-terminal-emulator 
> compatibility, but don't seem to affect this issue.)
> 
> urxvt, xterm, mate-terminal{,.wrapper}, xfce4-terminal{,.wrapper} and 
> terminator all hold the prompt till the window is closed.
> ---
> 
> On my test system, at the time, x-terminal-emulator pointed to 
> lxterminal, so it looks as if "exec" has nothing to do with this.
> 
> I'll have to do a bit of googling about why lxterminal and 
> gnome-terminal's behaviour has changed like this, though. Unless you 
> folks have any ideas?
> 
> I'd like my scripts to work the same regardless of what terminal a user 
> has set as x-terminal-emulator.
> 

It seems gnome-terminal has a complicated server-client setup, but the 
immediate prompt return can be avoided with 'gnome-terminal --wait':
https://bugzilla.gnome.org/show_bug.cgi?id=707899

Lxterminal (which I was more interested in) says "all instances of the 
terminal are sharing a single process" which explains that, but it can 
be bypassed with '--no-remote'.

So a check if x-terminal-emulator points to lxterminal and if so adding 
'--no-remote' should cover my needs. Sorry for the noise.

-- 
John

Back to linux.debian.user | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

dash/bash: exec behaviour change on Buster John Crawley <john@bunsenlabs.org> - 2019-07-17 09:50 +0200
  Re: dash/bash: exec behaviour change on Buster <tomas@tuxteam.de> - 2019-07-17 10:20 +0200
    Re: dash/bash: exec behaviour change on Buster "Thomas Schmitt" <scdbackup@gmx.net> - 2019-07-17 10:40 +0200
      Re: dash/bash: exec behaviour change on Buster John Crawley <john@bunsenlabs.org> - 2019-07-18 03:40 +0200
        Re: terminal window returns prompt (was: dash/bash: exec behaviour  change on Buster) John Crawley <john@bunsenlabs.org> - 2019-07-18 05:40 +0200
        Re: dash/bash: exec behaviour change on Buster Richard Hector <richard@walnut.gen.nz> - 2019-07-18 08:00 +0200
          Re: dash/bash: exec behaviour change on Buster John Crawley <john@bunsenlabs.org> - 2019-07-18 09:50 +0200

csiph-web