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

GNOME terminal not always present when using "Open in Shell" for first time #344

Open
jmejia32 opened this issue Sep 16, 2020 · 9 comments

Comments

@jmejia32
Copy link

Describe the bug

Can't open repository folder in terminal on Deepin DE (also fails on Deepin OS distro)

Version & OS

Github Desktop Version: 2.5.4-linux1
OS: Arch Linux x64 - kernel version: 5.8.8-arch1-1

Steps to reproduce the behavior

  1. Open a local repository
  2. Go to Repository menu
  3. Click on 'Open in GNOME(?) Terminal' menu item (no GNOME installed)
  4. Bang! Error message shown

Expected behavior

System's default Virtual Terminal Emulator (Deepin Terminal, in my case) started on repository folder

Actual behavior

This message:
image

Screenshots

image

Compared to referenced issue #167 , Deepin Terminal finally appears in shell menu
image

Logs

2020-09-16T17:11:11.064Z - info: [ui] Background fetch for 10 repositories took 1.321sec
2020-09-16T17:17:31.709Z - info: [ui] [AppStore] loading 10 repositories from store
2020-09-16T17:17:31.709Z - info: [ui] [AppStore] found account: jmejia32 (Javier Mejía Estrada)
2020-09-16T17:17:32.253Z - info: [ui] launching: 2.5.4-linux1 (Linux 5.8.8-arch1-1)
2020-09-16T17:17:32.254Z - info: [ui] execPath: '/opt/github-desktop/github-desktop'
2020-09-16T17:19:21.527Z - info: [ui] [AppStore] loading 9 repositories from store
2020-09-16T17:19:21.527Z - info: [ui] [AppStore] found account: jmejia32 (Javier Mejía Estrada)
2020-09-16T17:19:22.070Z - info: [ui] launching: 2.5.4-linux1 (Linux 5.8.8-arch1-1)
2020-09-16T17:19:22.071Z - info: [ui] execPath: '/opt/github-desktop/github-desktop'
@shiftkey
Copy link
Owner

shiftkey commented Nov 6, 2020

@jmejia32 apologies for the delay in replying.

Is this issue that "GNOME Terminal" is shown despite not having it installed? Or is the issue that Deepin Terminal doesn't work?

@jmejia32
Copy link
Author

jmejia32 commented Nov 6, 2020

@shiftkey "GNOME Terminal" is shown regardless it is installed or not, and Deepin Terminal works so far. Other applications call it as default terminal emulator.

@jmejia32
Copy link
Author

jmejia32 commented Nov 6, 2020

PD: Currently, I use Debian distro (11 - bullseye - testing branch) + Cinnamon DE because IT security requirements in office, but I have a dual boot of both systems and the issue still exists under that environment.

It is not related to Deepin only.

@shiftkey
Copy link
Owner

shiftkey commented Nov 6, 2020

"GNOME Terminal" is shown regardless it is installed or not, and Deepin Terminal works so far.

There's some history in here that I'm hazy on, but on initial launch we don't have a selected terminal and the placeholder we use is a best guess. This works fine on Windows and macOS because we know what shells are available by default, but clearly that won't work for Linux due to the different permutations of configurations available.

It'd be nice to be able to probe on this first launch and see what shells are installed, and choose the first valid shell, but I'm not sure if we have a suitable hook to do that.

@shiftkey shiftkey changed the title Can't open repository folder in Deepin Terminal GNOME terminal not always present when using "Open in Shell" for first time Jan 24, 2021
@Daniel-McCarthy
Copy link
Sponsor

Daniel-McCarthy commented Dec 27, 2021

Hi all, I am currently experiencing this issue as well on KDE Manjaro with GitHub Desktop installed from the AUR.
I have been troubleshooting this issue toIday as I noticed "GNOME Terminal" appeared instead of "Konsole" and gave this error when clicking it.

Interestingly, when I built GitHub Desktop from source and ran it, I found that the selectedShell variable actually did contain "Konsole" correctly, and that in the Integrations settings, Konsole was already selected, but showed "GNOME Terminal" in the labels anyways and attempted to launch GNOME Terminal instead.

I was able to see that when debugging app.tsx was passing down "GNOME Terminal" as a prop, and continued to do so even after saving the shell selection again. I tried placing a break point at the call to updatePreferredAppMenuItemLabels in app-store.tsx and it continued to show the wrong terminal. I saved the shell selection again with the breakpoint placed, and it showed "Konsole" finally, and the labels were successfully updated & I could launch it. It even persists after closing and launching the program.

In tried in my source-compiled Desktop instance but placed the breakpoint at _setShell in app-store.tsx and found once again it only successfully saved and the state successfully changed to Konsole when stepping through. Perhaps this is an indicator of a race condition causing the change to not save, resulting in the incorrect value to be passed down?


The TL;DR of this:

  • My install showed GNOME Terminal instead of Konsole for all labels and failed to launch the terminal.
  • The Integrations settings successfully showed Konsole as my current selected shell, despite the menu options showing the incorrect terminal. (Saving it didn't effect anything).
  • Only when stepping through the _setShell and _setExternalEditor methods in app-store.tsx and saving the selected shell/terminal did it successfully save, which resolved my issue even on relaunch.

I would be happy to provide more info on this to help debug this if needed. If there is a way to clear the setting to reproduce it, I would love to dig further.

@Interpause
Copy link

Hi all, I am currently experiencing this issue as well on KDE Manjaro with GitHub Desktop installed from the AUR. I have been troubleshooting this issue toIday as I noticed "GNOME Terminal" appeared instead of "Konsole" and gave this error when clicking it.

Interestingly, when I built GitHub Desktop from source and ran it, I found that the selectedShell variable actually did contain "Konsole" correctly, and that in the Integrations settings, Konsole was already selected, but showed "GNOME Terminal" in the labels anyways and attempted to launch GNOME Terminal instead.

I was able to see that when debugging app.tsx was passing down "GNOME Terminal" as a prop, and continued to do so even after saving the shell selection again. I tried placing a break point at the call to updatePreferredAppMenuItemLabels in app-store.tsx and it continued to show the wrong terminal. I saved the shell selection again with the breakpoint placed, and it showed "Konsole" finally, and the labels were successfully updated & I could launch it. It even persists after closing and launching the program.

In tried in my source-compiled Desktop instance but placed the breakpoint at _setShell in app-store.tsx and found once again it only successfully saved and the state successfully changed to Konsole when stepping through. Perhaps this is an indicator of a race condition causing the change to not save, resulting in the incorrect value to be passed down?

The TL;DR of this:

  • My install showed GNOME Terminal instead of Konsole for all labels and failed to launch the terminal.
  • The Integrations settings successfully showed Konsole as my current selected shell, despite the menu options showing the incorrect terminal. (Saving it didn't effect anything).
  • Only when stepping through the _setShell and _setExternalEditor methods in app-store.tsx and saving the selected shell/terminal did it successfully save, which resolved my issue even on relaunch.

I would be happy to provide more info on this to help debug this if needed. If there is a way to clear the setting to reproduce it, I would love to dig further.

If you don't want to patch it yourself, using the dev tools and setting breakpoints following the above post while changing the terminal emulator works without having to modify anything.

@Etaash-mathamsetty
Copy link

these issues are caused by gnome terminal being the default in the code, a simple way to fix this is to install a second different terminal, switch to it, then switch to the terminal you want to use, and then uninstall the second terminal. This worked well for me as shown in pr #700

@aminya
Copy link

aminya commented Nov 22, 2022

I have the same problem. On Kubuntu, the default terminal is the Konsole, but the "Open in " UI still shows the GNOME terminal, which doesn't work; giving a path error. KDE doesn't come with a GNOME terminal.

The workaround seems to be going into the setting and manually setting the integrations to Konsole.

I think the default terminal detection logic should be improved. Checking more famous terminal apps by default and skipping those that are not installed.

@khawkins98
Copy link

Thanks to @Daniel-McCarthy for the tip on working around this.

A few screenshots for posterity of my fix on KDE Manjaro.

  1. Stepping through _setShell

image

  1. Changing the string to "Konsole" (in my case)

image

  1. Then resume script execution and presto

image

khawkins98 added a commit to khawkins98/desktop that referenced this issue Jul 24, 2023
shiftkey pushed a commit to khawkins98/desktop that referenced this issue Jul 29, 2023
shiftkey pushed a commit that referenced this issue Jul 29, 2023
shiftkey pushed a commit that referenced this issue Aug 26, 2023
shiftkey pushed a commit that referenced this issue Aug 26, 2023
shiftkey pushed a commit that referenced this issue Aug 26, 2023
shiftkey pushed a commit that referenced this issue Aug 26, 2023
shiftkey pushed a commit that referenced this issue Aug 26, 2023
shiftkey pushed a commit that referenced this issue Sep 2, 2023
shiftkey pushed a commit that referenced this issue Sep 2, 2023
shiftkey pushed a commit that referenced this issue Sep 2, 2023
shiftkey pushed a commit that referenced this issue Sep 2, 2023
shiftkey pushed a commit that referenced this issue Sep 2, 2023
shiftkey pushed a commit that referenced this issue Apr 13, 2024
shiftkey pushed a commit that referenced this issue May 27, 2024
shiftkey pushed a commit that referenced this issue May 27, 2024
shiftkey pushed a commit that referenced this issue May 28, 2024
shiftkey pushed a commit that referenced this issue May 28, 2024
shiftkey pushed a commit that referenced this issue May 28, 2024
shiftkey pushed a commit that referenced this issue May 28, 2024
shiftkey pushed a commit that referenced this issue May 28, 2024
shiftkey pushed a commit that referenced this issue May 28, 2024
shiftkey pushed a commit that referenced this issue Jun 2, 2024
shiftkey pushed a commit that referenced this issue Jun 2, 2024
shiftkey pushed a commit that referenced this issue Jun 2, 2024
shiftkey pushed a commit that referenced this issue Jun 2, 2024
shiftkey pushed a commit that referenced this issue Jun 2, 2024
shiftkey pushed a commit that referenced this issue Jun 2, 2024
shiftkey pushed a commit that referenced this issue Jun 2, 2024
shiftkey pushed a commit that referenced this issue Jun 2, 2024
shiftkey pushed a commit that referenced this issue Jul 1, 2024
shiftkey pushed a commit that referenced this issue Jul 1, 2024
shiftkey pushed a commit that referenced this issue Jul 1, 2024
shiftkey pushed a commit that referenced this issue Jul 1, 2024
shiftkey pushed a commit that referenced this issue Jul 1, 2024
shiftkey pushed a commit that referenced this issue Jul 1, 2024
shiftkey pushed a commit that referenced this issue Jul 1, 2024
shiftkey pushed a commit that referenced this issue Jul 13, 2024
shiftkey pushed a commit that referenced this issue Aug 10, 2024
shiftkey pushed a commit that referenced this issue Aug 10, 2024
shiftkey pushed a commit that referenced this issue Aug 10, 2024
shiftkey pushed a commit that referenced this issue Aug 11, 2024
shiftkey pushed a commit that referenced this issue Aug 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants