https://bugs.kde.org/show_bug.cgi?id=459408

            Bug ID: 459408
           Summary: DesktopExecParser fails to launch terminal if
                    TerminalApplication has multiple arguments
    Classification: Unclassified
           Product: frameworks-kio
           Version: 5.97.0
          Platform: Fedora RPMs
                OS: Linux
            Status: REPORTED
          Severity: normal
          Priority: NOR
         Component: general
          Assignee: kio-bugs-n...@kde.org
          Reporter: accounts+...@chiller3.com
                CC: kdelibs-b...@kde.org
  Target Milestone: ---

SUMMARY

When the default terminal application is set to a terminal whose .desktop file
has multiple arguments in Exec=, launching the default terminal (eg. via
KTerminalLauncherJob) will fail.

STEPS TO REPRODUCE
1. Install a terminal that has multiple arguments in its .desktop entry (eg.
Wezterm's "Exec=wezterm start --cwd . --")
2. Set that terminal (eg. Wezterm) as the default terminal in system settings
3. Create a new .desktop file containing "Terminal=true" (to easily test
starting a terminal)
4. Launch the new .desktop file

OBSERVED RESULT

plasmashell fails to spawn a terminal with the following errors showing up in
journald:

    kf.kio.core: Terminal "wezterm start --cwd . --" not found, service
"TestDesktopFile"
    kf.kio.gui: "Terminal wezterm start --cwd . -- not found while trying to
run /home/chenxiaolong/.local/share/applications/testdesktopfile.desktop"

EXPECTED RESULT

The terminal should launch successfully.

SOFTWARE/OS VERSIONS
Windows: n/a
macOS: n/a
Linux/KDE Plasma: Fedora 36
KDE Plasma Version: 5.25.5
KDE Frameworks Version: 5.97.0
Qt Version: 5.15.5

ADDITIONAL INFORMATION

I believe the issue is how the default terminal config option is parsed in KIO.
When I set Wezterm as the default terminal, the following is written to
~/.config/kdeglobals:

    [General]
    TerminalApplication=wezterm start --cwd . --
    TerminalService=org.wezfurlong.wezterm.desktop

The TerminalApplication value is queried here:
https://invent.kde.org/frameworks/kio/-/blob/v5.97.0/src/core/desktopexecparser.cpp#L488
and passed to QStandardPaths::findExecutable() verbatim. I believe it's
searching PATH for the literal string "wezterm start --cwd . --" instead of
"wezterm".

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to