Bug 323227 - Changing the cursor using the terminal escape sequence clears the profile name
Summary: Changing the cursor using the terminal escape sequence clears the profile name
Status: RESOLVED FIXED
Alias: None
Product: konsole
Classification: Applications
Component: general (show other bugs)
Version: 2.11
Platform: Fedora RPMs Linux
: NOR normal
Target Milestone: ---
Assignee: Konsole Developer
URL:
Keywords:
: 344977 (view as bug list)
Depends on:
Blocks:
 
Reported: 2013-08-06 12:10 UTC by John Szakmeister
Modified: 2024-03-27 00:49 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description John Szakmeister 2013-08-06 12:10:56 UTC
I have a plugin called vim-togglecursor that will let users change their cursor shape when in insert mode on a terminal version of vim.  It's done using the CursorShape escape sequence that Konsole supports.  What we discovered at work the other day is that after launching a terminal version of Vim, the profile name would be cleared (instead of being the default "Shell").  After some work, we were able to narrow it down the escape sequence for changing the cursor shape.  ISTM, that changing the shape in this way should affect the profile.  Or, at least, when the shape is what the profile had originally set up, the profile name should remain (the plugin does restore the cursor shape on exit from vim).

Reproducible: Always

Steps to Reproduce:
1. Starts Konsole.
2. Select "Settings -> Configure Current Profile" from the menu.
3. Observe that the profile has a name and that the cursor type is setup as a block cursor.
4. In the terminal, type: printf "\e]50;CursorShape=1\x7\e]50;CursorShape=0\x7"
5. The above should flip the cursor to a line shape, and then back to a block shape.
6. Select "Settings -> Configure Current Profile" from the menu.
7. Observe that the profile name is now empty.
Actual Results:  
The profile name is empty after following the steps above.

Expected Results:  
I expect the current profile name to remain the same.
Comment 1 Kurt Hindenburg 2013-08-07 14:23:20 UTC
yes, printf "\e]50;CursorShape=1\x7" will do it also
Comment 2 Kurt Hindenburg 2013-08-08 13:11:25 UTC
After looking at this I recall this is the expected result.

You temporary changed the current profile so the profile name is blank - you could enter a new profile name and that configuration would be saved.

I would agree this isn't the best way of handling this (empty profile name is confusing).
Comment 3 John Szakmeister 2013-08-08 19:31:18 UTC
I'd say it's rather unexpected, as a user.  If my terminal app wants to change the cursor, I think it should be able to do so without altering the profile.

I think it would be better behavior if the only time the cursor shape should affected the profile, is through the menu and options.  That would at least match my expectations better.  FWIW, iTerm2 takes this approach as well (changing it in the terminal via escape codes doesn't affect the profile).  I believe iTerm2 was the initial inspiration for this feature too.

Thanks for looking into the issue!
Comment 4 Keerthan Jaic 2014-07-01 21:07:58 UTC
if konsole would support DECSCUSR(http://www.vt100.net/docs/vt510-rm/DECSCUSR), then applications could change the cursor shape without abusing the konsoleprofile escape sequence.

Additionally, it would be uniform with xterm, iterm etc.
Comment 5 Andriy Gapon 2017-09-05 07:39:18 UTC
Please see bug 347323 as well.
Comment 6 Ahmad Samir 2018-03-05 14:40:07 UTC
*** Bug 344977 has been marked as a duplicate of this bug. ***
Comment 7 Kurt Hindenburg 2024-03-27 00:49:45 UTC
I believe this works as you want in recent versions.  Reopen if there are still issues.