Bug 6015 - Terminal profile is broken for rxvt - can't use "exec foo || exec bar" in cmdline without shopt -s execfail
Summary: Terminal profile is broken for rxvt - can't use "exec foo || exec bar" in cmd...
Status: CLOSED DUPLICATE of bug 5696
Alias: None
Product: ThinLinc
Classification: Unclassified
Component: Desktop environment (show other bugs)
Version: trunk
Hardware: PC Linux
: P2 Minor
Target Milestone: 4.7.0
Assignee: Pierre Ossman
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-09-27 18:05 CEST by Karl Mikaelsson
Modified: 2016-09-29 14:39 CEST (History)
1 user (show)

See Also:
Acceptance Criteria:


Attachments

Description Karl Mikaelsson cendio 2016-09-27 18:05:27 CEST
Our terminal profile ships with support for multiple terminals - the testcmd checks for one of xterm and rxvt. Perhaps this hasn't been tested for very long, maybe it's fallout from bug 5099 - this is what happens on my Fedora 24 machine (bash 4.3.42):

> Executing profile: xterm
> Executing profile command: exec rxvt || exec xterm
> /bin/bash: rad 0: exec: rxvt: finns inte
> Profile command exited with exit code 127

(An observant reader will notice that I switched the order around to provoke the bug - I had xterm already installed. The default is "exec xterm || exec rxvt" and fails in the same way when you don't have xterm.)

In other words, the profile command only works with the first terminal exec'd.

To allow exec in non-interactive shells to fail gracefully, you have to "shopt -s execfail" first. The default is unset.

>  execfail
>   If set, a non-interactive shell will not exit if it cannot
>   execute the file specified as an argument to the exec builtin
>   command.  An interactive shell does not exit if exec fails.
Comment 1 Henrik Andersson cendio 2016-09-29 14:28:41 CEST
exec of terminals were introduced in 5696.

*** This bug has been marked as a duplicate of bug 5696 ***

Note You need to log in before you can comment on or make changes to this bug.