Summary: | Konsole switches back to previous profile settings on vim newline | ||
---|---|---|---|
Product: | [Applications] konsole | Reporter: | Cimbali <me> |
Component: | general | Assignee: | Konsole Developer <konsole-devel> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | a.samirh78 |
Priority: | NOR | ||
Version: | 21.08.3 | ||
Target Milestone: | --- | ||
Platform: | openSUSE | ||
OS: | Linux | ||
Latest Commit: | https://invent.kde.org/utilities/konsole/commit/97feb543975f7ae2ed2ab2b90ce9bdd348e10bed | Version Fixed In: | 21.12 |
Sentry Crash Report: | |||
Attachments: | screen capture of bug |
Description
Cimbali
2021-11-16 13:44:09 UTC
I couldn't reproduce this issue. Maybe try vim with any extra addons? This happens even with all plugins removed − but not with the vimrc removed. I’ll try and identify which option(s) are problematic and report back a minimal vimrc that reproduces the issue. I’ve found the problematic lines: let &t_SI = "\<Esc>]50;CursorShape=1\x7" let &t_SR = "\<Esc>]50;CursorShape=2\x7" let &t_EI = "\<Esc>]50;CursorShape=0\x7" The docs for there says: t_SI start insert mode (bar cursor shape) t_SI t_SR start replace mode (underline cursor shape) t_SR t_EI end insert or replace mode (block cursor shape) t_EI |termcap-cursor-shape| These control the cursor shapes to avoid displaying block cursors in all modes (i.e. bar in insert mode, underline in replace mode, and block in normal mode). Related discussions: - https://forum.kde.org/viewtopic.php?t=126004 - https://bugs.kde.org/show_bug.cgi?id=103399 So in fact vim is not needed to reproduce the bug, and it’s only selecting a CursorShape that reset profile options. Here’s alternate steps to reproduce: STEPS TO REPRODUCE 1. Change cursor shape, e.g. with: printf '\e]50;CursorShape=1\a' 2. Change profile 3. Change cursor shape again, e.g. with: printf '\e]50;CursorShape=0\a' OBSERVED RESULT Profile settings (e.g. colours) are changed back to initial settings from step 1 EXPECTED RESULT Profile settings are unaffected by changing cursor shape, only cursor shape should change. ---- Note that this doesn’t seem to happen with DECSCUSR codes, so a good workaround for my vim use case is to use instead: let &t_SI = "\<Esc>[6 q" let &t_SR = "\<Esc>[4 q" let &t_EI = "\<Esc>[2 q" In fact, changing the cursor shape with printf '\e]50;CursorShape=1\a' is changing a konsole profile setting, and “forking” the current profile. The “Edit current profile” option of the tab shows which profile is currently in use. Whether this forking is done or not before changing to a new profile, affects how the next cursor shape change behaves. It sets the cursor shape, with as a base (colours etc.) either: - the newly loaded profile (if there were no cursor changes before loading the new profile) - the previously forked profile (if there were cursor changes) This “forked” profile should point to (or at least have all its values replaced by) the newly loaded profile, if the behaviour is to be consistent. A possibly relevant merge request was started @ https://invent.kde.org/utilities/konsole/-/merge_requests/526 Thanks for the detailed report and investigation. Git commit 97feb543975f7ae2ed2ab2b90ce9bdd348e10bed by Kurt Hindenburg, on behalf of Ahmad Samir. Committed on 21/11/2021 at 03:24. Pushed by hindenburg into branch 'master'. Handle changing cursor shape property without creating a new profile Using an escape sequence, e.g. printf '\e]50;CursorShape=1\a', to change the cursor shape property like we handle DECSCUSR, i.e. as a transient change without creating a new profile (see SessionManager::sessionProfileCommandReceived()). To test: - printf '\e]50;CursorShape=1\a' to change the cursor shape, check that the current profile hasn't been switched to a new profile (that has no name as it's a temp profile) FIXED-IN: 21.12 M +13 -0 src/Vt102Emulation.cpp https://invent.kde.org/utilities/konsole/commit/97feb543975f7ae2ed2ab2b90ce9bdd348e10bed |