Bug 481504 - OSC-8 embedded URL only work after switching to same(!!!!) profile
Summary: OSC-8 embedded URL only work after switching to same(!!!!) profile
Status: CONFIRMED
Alias: None
Product: konsole
Classification: Applications
Component: general (show other bugs)
Version: 24.01.95
Platform: Debian stable Linux
: NOR normal
Target Milestone: ---
Assignee: Konsole Developer
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-02-18 10:32 UTC by Charlemagne Lasse
Modified: 2024-02-18 23:36 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Charlemagne Lasse 2024-02-18 10:32:04 UTC
SUMMARY

I wanted to test OSC-8 URLs in konsole. So I printed one which links to a specific line of file. This didn't didn't work at first because this feature is disabled by default. So I went to "Edit Current Profile" -> Mouse -> Miscellaneous and made sure following entries are enabled:

1. Underline links
2. Underline files
3. Text editor command: Kate
4. Allow escape sequences for links
5. Allowed link format: http://;https://;file://
6. Require Ctrl key for drag & drop
7. Enable Alternate Screen buffer profile
8. Disable drag & drop menu for files & URLs
9. Allow Ctrl+scrollweel to some text size
10. Preview colors on hover
11. Allow terminal application to handle clicks and drags

(so only "Open files/links by direct click" was not enabled)

Then I've closed konsole and tried following steps:

STEPS TO REPRODUCE
1. Open new konsole
2. run: printf '\e]8;;file:///etc/passwd#line:3\e\\Open passwd line 3\e]8;;\e\\\n'
3. try to click (with ctrl pressed) on the output -> Fails
4. Use Menubar -> Settings -> Switch Profile -> $CURRENT_PROFILE (which is the default according to settings)
5. run: printf '\e]8;;file:///etc/passwd#line:3\e\\Open passwd line 3\e]8;;\e\\\n'
6. try to click (with ctrl pressed) on the output -> kate opens with /etc/passwd on line 3

OBSERVED RESULT

First output cannot be clicked. The output after switching (to currently running) profile is clickable (and works)

EXPECTED RESULT

First + second output is clickable (and works)

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Debian bookworm amd64
(available in About System)
KDE Plasma Version: 5.27.5
KDE Frameworks Version: 5.103.0
Qt Version: 5.15.8

ADDITIONAL INFORMATION

* runs kwin11-wayland
* There is only two profiles available. "Built-in" and "Shell" (which is marked as default and uses a different color scheme than "Built-in"
* happens with both bash (system default config) and zsh (semantic shell configuration)
Comment 1 Charlemagne Lasse 2024-02-18 10:49:56 UTC
Just as info: The file detection which automatically creates the "links" to click on works perfectly fine. So for example, if I go into the konsole git repository and do following:

git grep -n EscapeSequenceUrlExtractor

Then I can ctrl+click on the file name + line number on the beginning of the line and kate opens at the right position. No need to switch to the already active profile
Comment 2 fanzhuyifan 2024-02-18 23:36:10 UTC
Can reproduce