flathub / com.vscodium.codium

https://flathub.org/apps/details/com.vscodium.codium
94 stars 19 forks source link

External Terminal won't open #340

Open timkenhan opened 1 month ago

timkenhan commented 1 month ago

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 commented 1 month ago

Same with gnome-terminal

daiyam commented 1 month ago

@Altonss Are you also on Gentoo?

timkenhan commented 1 month ago

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

noonsleeper commented 1 month ago

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 commented 1 month ago

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 commented 3 weeks ago

@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 commented 3 weeks ago

@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 "${@}"