Bug 341157

Summary: Konsole5 doesn't send Ctrl+Space anymore
Product: [Applications] konsole Reporter: Stefan Weigert <weigert.stefan>
Component: keyboardAssignee: Konsole Developer <konsole-devel>
Status: RESOLVED FIXED    
Severity: major CC: accounts+bugs.kde, adrian.metabind, anand.chirag, arthur, bastian.beischer, calvinh34, david.narvaez, fortitude.zhang, gilaldpellaeon, jason, john, lubomir.krajcovic, marcin.cieslik, nectuto, pasi.luostarinen, rgacogne-kdebugs, rubykuby, sabrewolfy, schnitzelkuchen, tavianator, tomdicksonhunt, torkjelh
Priority: NOR    
Version: 3.90.900   
Target Milestone: ---   
Platform: Kubuntu   
OS: Linux   
Latest Commit: Version Fixed In: 15.03.90
Sentry Crash Report:

Description Stefan Weigert 2014-11-21 09:33:41 UTC
I'm using Emacs within Konsole and in the qt4 - version pressing Ctrl+Space works properly and enables me to select text in Emacs. However, when I use the qt5 version of Konsole (from Kubuntu CI weekly) it does not work anymore (i.e. nothing happens in Emacs). Going to "Configure Profile", selecting "Keyboard" and then "Edit" (default xfree is selected) and then pressing Ctrl + Space in the input area does not generate anything in the output area.

Reproducible: Always

Steps to Reproduce:
1.open konsole
2.open emacs
3.press ctrl+space and then cursor down to select some lines

Actual Results:  
the cursor is moved but nothing is selected

Expected Results:  
the cursor is moved and the text is selected
Comment 1 David E. Narvaez 2015-01-17 15:48:08 UTC
FWIW, I tried qterminal (https://github.com/qterminal), whose code was originally based on konsole. As in konsole, the qt4 version works OK but the qt5 version does not send CTRL+Space so either qterminal and konsole both do the same thing wrong or this is broken at a deeper level in qt5. Notice that you can't send CTRL+@ either, so this looks like something deeper than keyboard bindings, i.e., it looks like konsole/qterminal cannot send ASCII char 0.
Comment 2 adrian.metabind 2015-01-26 22:04:56 UTC
Arch Linux x86_64

Name           : konsole
Version        : 14.12.1-1

Name           : plasma-workspace
Version        : 5.1.2-5

Name           : qt5-base
Version        : 5.4.0-3

Prior to "Transition of KDE software to the KDE Framework and Qt 5" update in Arch Linux, Ctrl-Space & Ctrl-@ were working in Konsole (Emacs).  They continue to work in rxvt and in the Emacs GUI app.  

This bug can be reproduced using `showkey -a' in Konsole.

This bug is a major annoyance for all Emacs developers using  "Konsole" since Ctrl-Space is one of the most heavily used and fundamental keybindings.
Comment 3 Florian Jacob 2015-02-01 22:44:43 UTC
I found the same behaviour when trying to use the vimwiki vim plugin, which uses ctrl+space to tick items as done in todo lists. I'm using konsole 14.12 / qt5-base 5.4.0 / kde worskpace 4.11.15 on Arch Linux.
Comment 4 calvinh34 2015-02-02 18:17:32 UTC
If it is of any help, I found that Yakuake running Qt4 still get the null-byte, while Konsole running Qt5 does not. Both are in from the same plasma5 session

$ yakuake --version
Qt : 4.8.6
Plate-forme de développement de KDE : 4.14.4
Yakuake : 2.9.9

$ konsole --version
Qt: 5.4.0
KDE Development Platform: TODO
Konsole: 3.0.1


Archlinux again
Comment 5 Pasi Luostarinen 2015-02-04 08:35:26 UTC
If you edit terminal layout and find "Ctrl + Space" and set it to \x0 then press ok and open again edit window the binding has been erased. This does not happen when \x1 is set as binding
Comment 6 fafi 2015-02-06 12:56:02 UTC
In midnight commander is used Ctrl + space to show size of directory.
Work around is to use F9 -> Command -> Shou directory sizes. It is not user friendly.
So bug is not only for emacs users...
Comment 7 Florian Jacob 2015-02-07 12:59:09 UTC
I can still reproduce this with Konsole 3.0.1 from Applications 14.12.2.
Comment 8 rubykuby 2015-02-12 16:22:15 UTC
cool-retro-term also has this exact issue: https://github.com/Swordfish90/cool-retro-term/issues/203

It appears to be related to Qt 5.4.
Comment 9 Christoph Feck 2015-02-15 14:15:27 UTC
*** Bug 343097 has been marked as a duplicate of this bug. ***
Comment 10 Chirag Anand 2015-02-24 20:57:45 UTC
Have submitted a review request: https://git.reviewboard.kde.org/r/122711/
Comment 11 Kurt Hindenburg 2015-03-01 23:30:53 UTC
Thanks - I'll look at this to get into the next release
Comment 12 Kurt Hindenburg 2015-03-07 14:45:15 UTC
Git commit 9d062f1f522a50aa5ec2ae2a95ce6124b4427b5b by Kurt Hindenburg.
Committed on 07/03/2015 at 14:42.
Pushed by hindenburg into branch 'master'.

Make Ctrl+Space work again

Qt5.4 appears to have caused this issue. Test using showkey, mc, emacs

Thanks to Chirag Anand anand chirag gmail com for fix
REVIEW: 122711

M  +1    -1    src/KeyboardTranslator.cpp
M  +1    -1    src/Vt102Emulation.cpp

http://commits.kde.org/konsole/9d062f1f522a50aa5ec2ae2a95ce6124b4427b5b
Comment 13 Kurt Hindenburg 2015-03-07 14:47:22 UTC
Git commit c16fc7d4671edf14c47132be0c621b08bce7dc82 by Kurt Hindenburg.
Committed on 07/03/2015 at 14:42.
Pushed by hindenburg into branch 'Applications/15.04'.

Make Ctrl+Space work again

Qt5.4 appears to have caused this issue. Test using showkey, mc, emacs

Thanks to Chirag Anand anand chirag gmail com for fix
REVIEW: 122711
(cherry picked from commit 9d062f1f522a50aa5ec2ae2a95ce6124b4427b5b)

M  +1    -1    src/KeyboardTranslator.cpp
M  +1    -1    src/Vt102Emulation.cpp

http://commits.kde.org/konsole/c16fc7d4671edf14c47132be0c621b08bce7dc82
Comment 14 fortitude.zhang@gmail.com 2016-03-01 15:04:25 UTC
Since I am using chinese input method, so ctrl-space is used by the ime. To use emacs, I have to use the ^@ in order to set mark.

However this bug seems still present in the following version:

fortitude@fortitude:~$ konsole --version
QCoreApplication::arguments: Please instantiate the QApplication object first
Qt: 5.5.1
KDE Frameworks: 5.19.0
Konsole: 15.12.2

While in urxvt everything is ok.
Comment 15 fortitude.zhang@gmail.com 2016-03-01 15:14:12 UTC
(In reply to fortitude.zhang@gmail.com from comment #14)
> Since I am using chinese input method, so ctrl-space is used by the ime. To
> use emacs, I have to use the ^@ in order to set mark.
> 
> However this bug seems still present in the following version:
> 
> fortitude@fortitude:~$ konsole --version
> QCoreApplication::arguments: Please instantiate the QApplication object first
> Qt: 5.5.1
> KDE Frameworks: 5.19.0
> Konsole: 15.12.2
> 
> While in urxvt everything is ok.

If I added a 2+Ctrl keybinding for konsole profile manually, Ctrl+2 will work for emacs. However, add @+Ctrl or 2+Shift+Ctrl does not work yet.
Comment 16 sabrewolfy 2016-07-19 09:08:37 UTC
This issue is not resolved for me:

Linux 4.4.0-31-generic #50-Ubuntu SMP Wed Jul 13 00:06:14 UTC 2016 i686 i686 i686 GNU/Linux

Qt: 5.5.1
KDE Frameworks: 5.18.0
Konsole: 15.12.3
Comment 17 Chirag Anand 2016-08-23 10:47:57 UTC
(In reply to fortitude.zhang@gmail.com from comment #15)
> If I added a 2+Ctrl keybinding for konsole profile manually, Ctrl+2 will
> work for emacs. However, add @+Ctrl or 2+Shift+Ctrl does not work yet.

(In reply to sabrewolfy from comment #16)

Can you please post the output of $ showkey -a?
Comment 18 sabrewolfy 2016-08-23 11:01:06 UTC
Chirag Anand: That command waits for me to press keys. Pressing Ctrl-Space doesn't do/output anything. It's not clear what you're asking for ... ?
Comment 19 Chirag Anand 2016-08-25 10:23:01 UTC
(In reply to sabrewolfy from comment #18)
> Chirag Anand: That command waits for me to press keys. Pressing Ctrl-Space
> doesn't do/output anything. It's not clear what you're asking for ... ?

If you can try running that command in another application, say xterm, then we would make sure this is a Konsole issue and not some system/keymap or some other issue.
Comment 20 sabrewolfy 2016-08-25 10:26:55 UTC
Ctrl-Space works in xterm on the same system.