GNOME Bugzilla – Bug 491807
allow specifying the exit mode on command line (keep terminal open)
Last modified: 2021-06-10 19:26:26 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.
Agreed. In the past I've done something like: gnome-terminal -x sh -c 'some-command || read' to get that behavior.
Created attachment 120054 [details] [review] proposed patch This is now really simple to implement :)
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.
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.
*** Bug 559114 has been marked as a duplicate of this bug. ***
*** Bug 566065 has been marked as a duplicate of this bug. ***
Is there a possibility to see a patch be applied to the next stable version of gnome-terminal?
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?
(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?
Well, with --exit-action, command line options are no longer orthogonal to profiles.
(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.
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.)
Patch needs to be updated to master (and lose the VTE_CHECK_VERSION stuff).
(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.
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.
*** Bug 604832 has been marked as a duplicate of this bug. ***
(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...
*** Bug 677826 has been marked as a duplicate of this bug. ***
*** Bug 778931 has been marked as a duplicate of this bug. ***
-- 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.