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.
yes, printf "\e]50;CursorShape=1\x7" will do it also
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).
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!
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.
Please see bug 347323 as well.
*** Bug 344977 has been marked as a duplicate of this bug. ***
I believe this works as you want in recent versions. Reopen if there are still issues.