Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[0.3.2 Regression] Using Contour as default terminal in KDE can't spawn apps because it only tries spawning -e #670

Closed
whisperity opened this issue May 2, 2022 · 15 comments · Fixed by #1110
Labels
bug Something isn't working frontend Contour Terminal Emulator (GUI frontend) platform: linux topics that directly address Linux platform (any distro)
Milestone

Comments

@whisperity
Copy link
Member

whisperity commented May 2, 2022

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

  1. Set Contour as default terminal
  2. Try starting htop from 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).

@whisperity whisperity added bug Something isn't working frontend Contour Terminal Emulator (GUI frontend) platform: linux topics that directly address Linux platform (any distro) labels May 2, 2022
@whisperity
Copy link
Member Author

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"

christianparpart added a commit that referenced this issue May 4, 2022
@christianparpart
Copy link
Member

-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. :)

@whisperity
Copy link
Member Author

Negative. Commit 21d6339 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, 7703fa2 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 😬). contour does not. contour -- bash does spawn bash.

In case of contour on commit 7703fa2:

╰─ contour
Unhandled error caught. Not enough arguments specified.

7703fa2 understands contour -e /usr/bin/htop properly, and starts that.

htop

@christianparpart
Copy link
Member

@whisperity you can try the binaries from #679. That at least fixes CI.

@christianparpart
Copy link
Member

7703fa2 understands contour -e /usr/bin/htop properly, and starts that.

htop

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. ;)

@whisperity
Copy link
Member Author

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:

contour [terminal] <...snip...> [PROGRAM ARGS...]

@christianparpart
Copy link
Member

I need a unit test for the CLI. Thanks @whisperity :-)

@christianparpart
Copy link
Member

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?

image

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.

@whisperity
Copy link
Member Author

whisperity commented May 6, 2022

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

@whisperity
Copy link
Member Author

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 259768a (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"

@christianparpart
Copy link
Member

Okay, so let's fix the Success then :)

@whisperity
Copy link
Member Author

FYI: On Ubuntu 20.04:

image

when contour is set as the default terminal application:

image

KDE still puts the -e flag there:

image

@whisperity whisperity added this to the 0.3.12 milestone Apr 10, 2023
@christianparpart
Copy link
Member

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) :)

@whisperity
Copy link
Member Author

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"

@Yaraslaut
Copy link
Member

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"

This is what i see on master at the moment
image

  • extra new line character fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working frontend Contour Terminal Emulator (GUI frontend) platform: linux topics that directly address Linux platform (any distro)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants