After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 491807 - allow specifying the exit mode on command line (keep terminal open)
allow specifying the exit mode on command line (keep terminal open)
Status: RESOLVED OBSOLETE
Product: gnome-terminal
Classification: Core
Component: general
unspecified
Other Linux
: Normal enhancement
: ---
Assigned To: GNOME Terminal Maintainers
GNOME Terminal Maintainers
: 559114 566065 604832 677826 778931 (view as bug list)
Depends on: 509204
Blocks:
 
 
Reported: 2007-10-30 17:58 UTC by Josh Lee
Modified: 2021-06-10 19:26 UTC
See Also:
GNOME target: ---
GNOME version: Unversioned Enhancement


Attachments
proposed patch (2.13 KB, patch)
2008-10-06 21:04 UTC, Christian Persch
none Details | Review
complete patch (9.56 KB, patch)
2008-10-09 18:51 UTC, Christian Persch
needs-work Details | Review

Description Josh Lee 2007-10-30 17:58:49 UTC
The terminal in Mac OS X has an option to hold the terminal open, but only when the command returns an error status. I think this would be an ideal default behaviour.

Examples:

 - When launching (say, with the run dialog) a command that requires command-line arguments, the user can see the error message instead of a useless flash.
 - When running a gui application in a terminal, if there are no problems, the now-useless terminal window closes automatically, but if there are problems, they stay up and can be examined.
Comment 1 Behdad Esfahbod 2007-10-30 18:59:21 UTC
Agreed.  In the past I've done something like:

gnome-terminal -x sh -c 'some-command || read'

to get that behavior.
Comment 2 Christian Persch 2008-10-06 21:04:30 UTC
Created attachment 120054 [details] [review]
proposed patch

This is now really simple to implement :)
Comment 3 Behdad Esfahbod 2008-10-06 21:26:30 UTC
Christian, how about not cluttering g-t source code by version-specific code?  g-t trunk can always require vte trunk.  Latest g-t unstable tarball requires latest vte unstable tarball.  And latest g-t stable tarball requires latest vte stable tarball.
Comment 4 Christian Persch 2008-10-09 18:51:29 UTC
Created attachment 120297 [details] [review]
complete patch

Now with command line args to set the exit action.

Feedback appreciated on the option name / whether we should have them all or just one --exit-action with a string parameter; and on the name of the new option in the profile preferences dialogue ("Hold the terminal open only on nonzero exit status" is rather long... shorter suggestions?). Should there also be a 5th, hold-on-zero-status action to complete the options set?

Behdad: I mostly agree, but prefer to have the version defines while there's not been a tarball of the new vte APIs yet, so I don't always have to do vte as prereq to doing a g-t release. Once there's been a tarball, dropping the defines is fine.
Comment 5 Christian Persch 2008-11-03 14:27:31 UTC
*** Bug 559114 has been marked as a duplicate of this bug. ***
Comment 6 Christian Persch 2008-12-30 17:17:49 UTC
*** Bug 566065 has been marked as a duplicate of this bug. ***
Comment 7 Jean-Philippe Fleury 2009-02-10 20:59:40 UTC
Is there a possibility to see a patch be applied to the next stable version of gnome-terminal?
Comment 8 Mariano Suárez-Alvarez 2009-02-10 21:17:13 UTC
Wouldn't it be simpler to have one command line option with a string argument?

BTW, the last observation in the HACKING file should be probably removed after
adding the command line option, no?
Comment 9 Christian Persch 2009-02-10 21:35:53 UTC
(In reply to comment #7)
> Is there a possibility to see a patch be applied to the next stable version of
> gnome-terminal?

No; 2.26 is already feature frozen.

(In reply to comment #8)
> Wouldn't it be simpler to have one command line option with a string argument?

That's what I was asking in comment 4, yes.

> BTW, the last observation in the HACKING file should be probably removed after
> adding the command line option, no?

The file is outdated, but I don't see anything in it that specifically refers to this bug? 

Comment 10 Mariano Suárez-Alvarez 2009-02-10 21:48:07 UTC
Well, with --exit-action, command line options are no longer orthogonal to profiles.
Comment 11 Jean-Philippe Fleury 2009-02-10 21:53:28 UTC
(In reply to comment #10)
> Well, with --exit-action, command line options are no longer orthogonal to
> profiles.

What do you mean by "orthogonal"?

Thanks.
Comment 12 Christian Persch 2009-02-10 22:14:54 UTC
I guess you mean this comment in src/terminal.c:

 * The number one rule: all stored information is EITHER per-session,
 * per-profile, or set from a command line option. THERE CAN BE NO
 * OVERLAP. The UI and implementation totally break if you overlap
 * these categories. See gnome-terminal 1.x for why.

You're right that this feature would break that. (Although it is already broken by --title vs. profile title and -e/-x vs. profile command.)
Comment 13 Christian Persch 2009-05-26 20:33:35 UTC
Patch needs to be updated to master (and lose the VTE_CHECK_VERSION stuff).
Comment 14 Jean-Philippe Fleury 2009-09-14 13:15:24 UTC
(In reply to comment #13)
> Patch needs to be updated to master (and lose the VTE_CHECK_VERSION stuff).

Hi,

Is there a roadmap for the update of this patch to master?

Thanks.
Comment 15 Christian Persch 2009-09-14 13:36:35 UTC
Updating the patch to master isn't any problem; but for this to be accepted there first needs to be some feedback as requested in my comment 4, and also there is the fundamental problem that comment 10 ff mentions.
Comment 16 Christian Persch 2009-12-17 14:09:57 UTC
*** Bug 604832 has been marked as a duplicate of this bug. ***
Comment 17 Behdad Esfahbod 2009-12-18 11:53:46 UTC
(In reply to comment #4)
> Created an attachment (id=120297) [details] [review]
> complete patch
> 
> Now with command line args to set the exit action.
> 
> Feedback appreciated on the option name / whether we should have them all or
> just one --exit-action with a string parameter;

Just one.  Maybe have a --hold shorthand.

> and on the name of the new
> option in the profile preferences dialogue ("Hold the terminal open only on
> nonzero exit status" is rather long... shorter suggestions?). Should there also
> be a 5th, hold-on-zero-status action to complete the options set?

Maybe "on error".  I can't imagine a valid usecase for holding on zero only.


(In reply to comment #10)
> Well, with --exit-action, command line options are no longer orthogonal to
> profiles.

This is not the case for many features now.  Latest one being default-size stuff I added which can be overriden using --geometry.

Lets get this in...
Comment 18 Christian Persch 2012-06-10 22:06:45 UTC
*** Bug 677826 has been marked as a duplicate of this bug. ***
Comment 19 Christian Persch 2017-02-20 16:24:21 UTC
*** Bug 778931 has been marked as a duplicate of this bug. ***
Comment 20 GNOME Infrastructure Team 2021-06-10 19:26:26 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to GNOME's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/gnome-terminal/-/issues/6350.