contour
contour copied to clipboard
[0.3.2 Regression] Using Contour as default terminal in KDE can't spawn apps because it only tries spawning `-e`
Contour Terminal version
0.3.2.3233
Installer source
Github: CI actions
Operating System
Ubuntu 18.04.6
Architecture
x86-64
Other Software
No response
Steps to reproduce
- Set Contour as default terminal
- Try starting
htopfrom start menu
Expected Behavior
Application starts.
Actual Behavior
KDE tries to spawn contour -e /usr/bin/htop, and Contour only shows this:
Failed to spawn "-e". Success
Trying login shell: "/bin/bash"
Additional notes
Used to work in version 0.3.0.3077-prerelease (early April 2022).
Sidenote: -- as a "separator for contour flags and the binary invocation" doesn't seem to work either. But I am not sure if it ever worked. -e worked before.
$ contour profile custom -- bash -i
Failed to spawn "--". Success
Trying login shell: "/bin/bash"
-e and -- is implemented both now and on master. @whisperity can you verify success with your KDE from Ubuntu 18.04? That would be great. :)
Negative. Commit 21d6339a21252a368d9121891dafc621726a0d22 is completely broken. No matter the combination of -e and -- and program-name flags, Contour always shows an
Unhandled error caught. Unexpected index
error and exits with return code 1. No signal is generated. In case of a GUI-based start, it just immediately dies without creating a window widget.
Commit parent to that, 7703fa2d45521e21c13d9fb54c08c04d9a001e80 is capable of spawning Contour, as long as -- OR a program name is given, i.e. contour -- and contour bash works (but it spawn ZSH :grimacing:). contour does not. contour -- bash does spawn bash.
In case of contour on commit 7703fa2d45521e21c13d9fb54c08c04d9a001e80:
╰─ contour
Unhandled error caught. Not enough arguments specified.
7703fa2d45521e21c13d9fb54c08c04d9a001e80 understands contour -e /usr/bin/htop properly, and starts that.

@whisperity you can try the binaries from #679. That at least fixes CI.
7703fa2 understands
contour -e /usr/bin/htopproperly, and starts that.
Note, in situations like these, I think it makes sense to also have the title reflect what you're executing. This is off-topic, but your screenshot actually reminded me. ;)
you can try the binaries from #679. That at least fixes CI.
contour :heavy_check_mark:
contour bash ❌ (it starts the default terminal from the profile, in my case ZSH)
contour htop ❌ (ditto.)
contour -e bash :heavy_check_mark:
contour -e htop :heavy_check_mark:
contour -- bash :heavy_check_mark:
contour -- htop :heavy_check_mark:
The two ❌s are regressions, and contradict the output of contour help:
contour [terminal] <...snip...> [PROGRAM ARGS...]
I need a unit test for the CLI. Thanks @whisperity :-)
contour bash❌ (it starts the default terminal from the profile, in my case ZSH)contour htop❌ (ditto.)
do you actually get an error message on top of the terminal window, saying that it can't spawn up bash or htop?
This is what I get when trying to spawn up `contour htop`. Which makes sense, because `htop` is not fully qualified. I could mimmick the default behaviour by iterating through $PATH and see if we get a fit.
do you actually get an error message
~~No. It just silently starts the default shell configured in my profile (ZSH), as if I never specified a program to start.~~
I tried again. No, I do not get an error message, but it seems to start the binary no problem, even when unqualified... (That should be the proper behaviour.) I am unsure... Maybe I was in the wrong directory, using the wrong contour executable yesterday afternoon.
0.3.2.3263
Okay, I am more than certain now that last afternoon I f***ed up, and ran the contour binary installed on my system, and not the one I downloaded the CI. To make sure, I did a full reinstall from the CI job for 259768ac4d25f853e07999fa0ef110cc6b270e99 (http://github.com/contour-terminal/contour/actions/runs/2276928846) and I can say all combinations (``, -e, --, then bash, htop, zsh, whatever) works as expected.
The only nit is that when I was whatever, I get:
Failed to spawn "whatever". Success
Trying login shell: "/bin/bash"
That Success is a bit weird here. Shouldn't it be ENOENT, because there is no whatever binary?
Failed to spawn "this-image-does-not-exist". Success
Trying login shell: "/bin/bash"
Failed to spawn "/". Success
Trying login shell: "/bin/bash"
Okay, so let's fix the Success then :)
FYI: On Ubuntu 20.04:

when contour is set as the default terminal application:

KDE still puts the -e flag there:

you can try the binaries from #679. That at least fixes CI.
contour✔️contour bash❌ (it starts the default terminal from the profile, in my case ZSH)contour htop❌ (ditto.)contour -e bash✔️contour -e htop✔️contour -- bash✔️contour -- htop✔️The two ❌s are regressions, and contradict the output of
contour help:
@whisperity i was looking around and testing. seems like we can close this ticket now? I've tested also the two ❌ cases and they all seem to work nicely. Am I missing anything?
Also setting default terminal to Contour works on my KDE (whose KDE UI looks slightly different due to being a more recent KDE version, obviously) :)
As of:
Contour Terminal Emulator 0.3.12.4932
contour bash and contour htop does work appropriately. But the "errno" printing is still wrong:
$ contour shit
(note also explicit newline:)
Failed to spawn "shit". Success
Trying login shell: "/bin/bash"
As of:
Contour Terminal Emulator 0.3.12.4932
contour bashandcontour htopdoes work appropriately. But the "errno" printing is still wrong:$ contour shit(note also explicit newline:)
Failed to spawn "shit". Success Trying login shell: "/bin/bash"
This is what i see on master at the moment
- extra new line character fixed