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

External Terminal won't open #340

Open
timkenhan opened this issue May 31, 2024 · 7 comments
Open

External Terminal won't open #340

timkenhan opened this issue May 31, 2024 · 7 comments
Assignees

Comments

@timkenhan
Copy link

I've been using the flatpak VSCodium for a while, and I haven't been able to open external terminal.

The .deb version never seem to have this issue. Perhaps this is some kind of sandbox related issue?

I was just trying it out on my Gentoo system running KDE, but I've reproduced the same behavior on Debian (also running KDE) as well as Linux Mint (running Cinnamon). On the Window output, this message appears everytime I hit Ctrl-Shift-C:

2024-05-31 16:19:29.006 [error] spawn /usr/bin/konsole ENOENT: Error: spawn /usr/bin/konsole ENOENT
    at ChildProcess._handle.onexit (node:internal/child_process:284:19)
    at onErrorNT (node:internal/child_process:477:16)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21)

I've tried playing around with the terminal.external.linuxExec with both the original /usr/bin/xterm as well as the current /usr/bin/konsole, neither of which seems to work.

@Altonss
Copy link

Altonss commented May 31, 2024

Same with gnome-terminal

@daiyam
Copy link
Collaborator

daiyam commented Jun 4, 2024

@Altonss Are you also on Gentoo?

@timkenhan
Copy link
Author

@daiyam this issue is also found on Debian & Mint (Ubuntu-based)

@noonsleeper
Copy link
Collaborator

noonsleeper commented Jun 7, 2024

Hi @timkenhan & @Altonss, can you try to change from flatpak-spawn to host-spawn https://github.com/flathub/com.vscodium.codium?tab=readme-ov-file#host-shell ?

@noonsleeper noonsleeper self-assigned this Jun 7, 2024
@noonsleeper
Copy link
Collaborator

noonsleeper commented Jun 7, 2024

I found that terminal.external.linuxExec try to launch binaries within the container (as expected because is inside of one), and does not accept parameters.

Then a workaround will be trying to create a simple script to launch your terminal and put on a place that codium can reach like $HOME/.local/bin/external-terminal

#!/usr/bin/env bash

function external(){
        host-spawn "<YOUR_TERMINAL>" "${@}"
}

external "${@}"

then change the permission to exec like chmod +x $HOME/.local/bin/external-terminal and add the full pathname on the setting like

"terminal.external.linuxExec": "<FILL_WITH_FULL_PATH_TO_SCRIPT>/external-terminal",

This will do the trick

@timkenhan
Copy link
Author

@noonsleeper I've tried your example but it doesn't seem to work either.

2024-06-13 12:43:55.304 [error] spawn /var/home/person/.local/bin/external-terminal ENOENT: Error: spawn /var/home/$USER/.local/bin/external-terminal ENOENT
    at ChildProcess._handle.onexit (node:internal/child_process:286:19)
    at onErrorNT (node:internal/child_process:484:16)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21)

After changing $USER to my username person:

2024-06-13 12:44:56.568 [error] spawn /var/home/person/.local/bin/external-terminal ENOENT: Error: spawn /var/home/person/.local/bin/external-terminal ENOENT
    at ChildProcess._handle.onexit (node:internal/child_process:286:19)
    at onErrorNT (node:internal/child_process:484:16)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21)

I've ensured the script is executable at the designated path.

@noonsleeper
Copy link
Collaborator

@timkenhan is /var/home/person your current $HOME if not move the script to that place like this mv /var/home/person/.local/bin/external-terminal $HOME/.local/bin/external-terminal (be sure before run this that $HOME/.local/bin/ exists), and try again.

Also, I don't use KDE but Gnome, then remember to change "gnome-terminal" in the script with "konsole" like:

$HOME/.local/bin/external-terminal

#!/usr/bin/env bash

function external(){
        host-spawn "konsole" "${@}"
}

external "${@}"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants