Control (CTRL) + Space keyboard shortcut not working #165

Closed
opened 2014-10-22 01:50:52 +02:00 by ghost · 20 comments
ghost commented 2014-10-22 01:50:52 +02:00 (Migrated from github.com)

I use the keyboard shortcut Ctrl + Space as my escape character sequence in GNU Screen, and I discovered that it doesn't work in cool-retro-term. The terminal doesn't seem to recognize that key combination at all!

Steps to reproduce:

  1. Start cool-retro-term
  2. Run showkey -a
  3. Hit ctrl + space

Observed behavior:
Nothing is output by showkey, indicating that the terminal has failed to process the keyboard event

Expected behavior:
showkey outputs:

^@ 0 0000 0x00

This, sadly, prevents me from using cool-retro-term for remote connections.

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

I use the keyboard shortcut Ctrl + Space as my escape character sequence in GNU Screen, and I discovered that it doesn't work in cool-retro-term. The terminal doesn't seem to recognize that key combination at all! Steps to reproduce: 1. Start cool-retro-term 2. Run showkey -a 3. Hit ctrl + space Observed behavior: Nothing is output by showkey, indicating that the terminal has failed to process the keyboard event Expected behavior: showkey outputs: ^@ 0 0000 0x00 This, sadly, prevents me from using cool-retro-term for remote connections. ## <bountysource-plugin> Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/5437778-control-ctrl-space-keyboard-shortcut-not-working?utm_campaign=plugin&utm_content=tracker%2F479407&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F479407&utm_medium=issues&utm_source=github). </bountysource-plugin>
Swordfish90 commented 2014-11-03 12:02:51 +01:00 (Migrated from github.com)

Yes, this is definitely an issue. I will look into it. Thanks.

Yes, this is definitely an issue. I will look into it. Thanks.
tprk77 commented 2014-12-08 21:45:00 +01:00 (Migrated from github.com)

This also affects Emacs, where is C-space is a pretty common sequence for setting the mark. I've also noticed the C-_ doesn't work, which is Emacs undo. Most keys seem to work though.

This also affects Emacs, where is C-space is a pretty common sequence for setting the mark. I've also noticed the C-_ doesn't work, which is Emacs undo. Most keys seem to work though.
Swordfish90 commented 2015-01-05 13:18:50 +01:00 (Migrated from github.com)

Just a quick update. Yesterday I took a deeper look into this issue and I think it's a regression from qt4 to qt5. Upstream qtermwidget is also effected (qt5 only) and it also seem that konsole also have this issue https://bugs.kde.org/show_bug.cgi?id=341157 . We'll see if they can come up with a proper solution.

Just a quick update. Yesterday I took a deeper look into this issue and I think it's a regression from qt4 to qt5. Upstream qtermwidget is also effected (qt5 only) and it also seem that konsole also have this issue https://bugs.kde.org/show_bug.cgi?id=341157 . We'll see if they can come up with a proper solution.
surrealchemist commented 2015-01-13 21:12:21 +01:00 (Migrated from github.com)

Seeing similar thing on the mac build I just did. I regularly use ctrl-r to jump to parts my bash history quickly and ctrl-d to log out of servers and neither register. Also just remembered screen uses ctrl for pretty much all the commands so it renders screen a little useless not being able to detach or switch screens.

EDIT: Just read the other report about the custom qt4 build and that seems to be working fine, so thanks.

Seeing similar thing on the mac build I just did. I regularly use ctrl-r to jump to parts my bash history quickly and ctrl-d to log out of servers and neither register. Also just remembered screen uses ctrl for pretty much all the commands so it renders screen a little useless not being able to detach or switch screens. EDIT: Just read the other report about the custom qt4 build and that seems to be working fine, so thanks.
Swordfish90 commented 2015-01-13 21:22:09 +01:00 (Migrated from github.com)

@surrealchemist Those are two different issues. Ctrl+R and Ctrl+D should be working fine on all platforms. Ctrl shortcut are not working on OSX when built with Qt 5.4 (https://github.com/Swordfish90/cool-retro-term/issues/203).

@surrealchemist Those are two different issues. Ctrl+R and Ctrl+D should be working fine on all platforms. Ctrl shortcut are not working on OSX when built with Qt 5.4 (https://github.com/Swordfish90/cool-retro-term/issues/203).
surrealchemist commented 2015-01-13 21:24:02 +01:00 (Migrated from github.com)

Hah yeah, I was just updating my comment after reading the other issues. Thanks.

Hah yeah, I was just updating my comment after reading the other issues. Thanks.
Swordfish90 commented 2015-04-03 19:20:22 +02:00 (Migrated from github.com)

This issue has been fixed in konsole and I just included the patch. It's already in unstable, let me know if there is any major regression. https://github.com/Swordfish90/cool-retro-term/tree/unstable

This issue has been fixed in konsole and I just included the patch. It's already in unstable, let me know if there is any major regression. https://github.com/Swordfish90/cool-retro-term/tree/unstable
ghost commented 2015-04-03 21:39:48 +02:00 (Migrated from github.com)

Thanks for looking into this, Swordfish90. Unfortunately, I followed the steps to clone the repo, and then did:

git checkout unstable

git log shows my HEAD at: bf99376... "Update engine. This fixes the CTRL+Space behaviour."

After qmake && make, ./cool-retro-term still doesn't seem to handle CTRL + Space. showkeys -a just outputs nothing when I use that key combo.

I notice the diff for that commit is just one line: bf9937619e

Is that right? Do I have to do some other step? Thanks!

Thanks for looking into this, Swordfish90. Unfortunately, I followed the steps to clone the repo, and then did: git checkout unstable git log shows my HEAD at: bf99376... "Update engine. This fixes the CTRL+Space behaviour." After qmake && make, ./cool-retro-term still doesn't seem to handle CTRL + Space. showkeys -a just outputs nothing when I use that key combo. I notice the diff for that commit is just one line: https://github.com/Swordfish90/cool-retro-term/commit/bf9937619e6fb988f432e10d91ee7b41a5e54355 Is that right? Do I have to do some other step? Thanks!
Swordfish90 commented 2015-04-04 09:35:49 +02:00 (Migrated from github.com)

You're welcome. I'm actually sorry it took so long.

Anyway you probably need to update the submodules (the fix is actually in qmltermwidget and the commit you are linking just points to a newer version).
In the project folder, with the unstable branch just run:

git submodule init

It should pull the latest version of the terminal plugin. If something is now working please try again the full procedure:

git clone --recursive https://github.com/Swordfish90/cool-retro-term
git checkout unstable
git submodule init

You're welcome. I'm actually sorry it took so long. Anyway you probably need to update the submodules (the fix is actually in qmltermwidget and the commit you are linking just points to a newer version). In the project folder, with the unstable branch just run: git submodule init It should pull the latest version of the terminal plugin. If something is now working please try again the full procedure: git clone --recursive https://github.com/Swordfish90/cool-retro-term git checkout unstable git submodule init
ghost commented 2015-04-04 22:02:55 +02:00 (Migrated from github.com)

I feel like something may be going wrong with updating qmltermwidget. Here are my steps and some truncated output that may be relevant:

rm -rf cool-retro-term/
git clone --recursive https://github.com/Swordfish90/cool-retro-term

...
Submodule path 'qmltermwidget': checked out 'dbf93d175c66ab9d6cdbf42443569d4a1c83c5b2'
...

c cool-retro-term/
git checkout unstable

M   qmltermwidget
Branch unstable set up to track remote branch unstable from origin.
Switched to a new branch 'unstable'

git branch -a

    master
* unstable
    remotes/origin/HEAD -> origin/master
    remotes/origin/add-pixelated-fonts
    remotes/origin/fast-burnin
    remotes/origin/fix-color-dialog
    remotes/origin/fix-color-dialog-2
    remotes/origin/improve-burn-in
    remotes/origin/ioprofiles
    remotes/origin/longburnin
    remotes/origin/master
    remotes/origin/osx
    remotes/origin/unstable

c qmltermwidget/
git branch -a

* (detached from dbf93d1)
    master
    remotes/origin/HEAD -> origin/master
    remotes/origin/master
    remotes/origin/vanilla
    remotes/origin/vanilla-fix-last-line
    remotes/origin/vanilla-mousemarks-signal

c ..
git submodule init
qmake && make

And it results in the same behavior.

Is it possible that some config file in .config or elsewhere is interfering?

I feel like something may be going wrong with updating qmltermwidget. Here are my steps and some truncated output that may be relevant: rm -rf cool-retro-term/ git clone --recursive https://github.com/Swordfish90/cool-retro-term ``` ... Submodule path 'qmltermwidget': checked out 'dbf93d175c66ab9d6cdbf42443569d4a1c83c5b2' ... ``` c cool-retro-term/ git checkout unstable ``` M qmltermwidget Branch unstable set up to track remote branch unstable from origin. Switched to a new branch 'unstable' ``` git branch -a ``` master * unstable remotes/origin/HEAD -> origin/master remotes/origin/add-pixelated-fonts remotes/origin/fast-burnin remotes/origin/fix-color-dialog remotes/origin/fix-color-dialog-2 remotes/origin/improve-burn-in remotes/origin/ioprofiles remotes/origin/longburnin remotes/origin/master remotes/origin/osx remotes/origin/unstable ``` c qmltermwidget/ git branch -a ``` * (detached from dbf93d1) master remotes/origin/HEAD -> origin/master remotes/origin/master remotes/origin/vanilla remotes/origin/vanilla-fix-last-line remotes/origin/vanilla-mousemarks-signal ``` c .. git submodule init qmake && make And it results in the same behavior. Is it possible that some config file in .config or elsewhere is interfering?
Swordfish90 commented 2015-04-05 17:49:35 +02:00 (Migrated from github.com)

For some reasons the qmltermwidget plugin is still in the wrong version. Please delete the cool-retro-term folder and completely re-clone the project with:

git clone --recursive -b unstable https://github.com/Swordfish90/cool-retro-term

This automatically retrieve the unstable branch and update the plugin to the correct version.

For some reasons the qmltermwidget plugin is still in the wrong version. Please delete the cool-retro-term folder and completely re-clone the project with: git clone --recursive -b unstable https://github.com/Swordfish90/cool-retro-term This automatically retrieve the unstable branch and update the plugin to the correct version.
ghost commented 2015-04-05 18:39:04 +02:00 (Migrated from github.com)

Thanks! By checking it out with the clone command it mysteriously worked. Is this a git thing?

It looks like I have the ability to close this bug, so I shall!

Thanks! By checking it out with the clone command it mysteriously worked. Is this a git thing? It looks like I have the ability to close this bug, so I shall!
Swordfish90 commented 2015-04-05 22:55:19 +02:00 (Migrated from github.com)

Glad to hear it's working for you. Yeah, it seems there were some mistakes updating the submodules when changing the branch. I'm reopening the issue, I'll close it when the fix is merged in master (to avoid possible duplications).

Glad to hear it's working for you. Yeah, it seems there were some mistakes updating the submodules when changing the branch. I'm reopening the issue, I'll close it when the fix is merged in master (to avoid possible duplications).
tprk77 commented 2015-04-08 22:20:24 +02:00 (Migrated from github.com)

C-Space works! Thank you!

However, C-_ (Emacs undo) is still not working... Maybe that is a separate issue?

C-Space works! Thank you! However, C-_ (Emacs undo) is still not working... Maybe that is a separate issue?
Swordfish90 commented 2015-04-12 11:28:33 +02:00 (Migrated from github.com)

@tprk77 . You're welcome. I think the two issues are not related. Could you try to reproduce it in konsole (build with qt5) (https://projects.kde.org/projects/kde/applications/konsole) and qtermwidget (https://github.com/qterminal/qtermwidget)?
It would be great to understand if it's a regression we somehow introduced, or if it's something we inherited.

@tprk77 . You're welcome. I think the two issues are not related. Could you try to reproduce it in konsole (build with qt5) (https://projects.kde.org/projects/kde/applications/konsole) and qtermwidget (https://github.com/qterminal/qtermwidget)? It would be great to understand if it's a regression we somehow introduced, or if it's something we inherited.
kent-engstrom commented 2019-02-18 17:50:56 +01:00 (Migrated from github.com)

I recently rediscovered cool-retro-term and tried to start to use it again, but ran into problems using Emacs, as Ctrl-Space does not seem to get passed on to the program running inside the terminal.

I'm trying this on Fedora 28, building from source from the instructions in README.md. I have tried both
master and unstable, newly cloned today:

~/git/cool-retro-term% git branch -v

  • master f89aeec Merge pull request #512 from timm0e/patch-1
    ~/git/cool-retro-term% git submodule status
    48274c75660e28d44af7c195e79accdf1bd44963 qmltermwidget (0.6.0-323-g48274c7)

and

~/git/cool-retro-term-unstable% git branch -v

  • unstable cdbe8d7 Bump version code.
    ~/git/cool-retro-term-unstable% git submodule status
    ddd71acdd4d5f6a8f764daec679eadcc100e4d9a qmltermwidget (0.6.0-322-gddd71ac)
I recently rediscovered cool-retro-term and tried to start to use it again, but ran into problems using Emacs, as Ctrl-Space does not seem to get passed on to the program running inside the terminal. I'm trying this on Fedora 28, building from source from the instructions in README.md. I have tried both master and unstable, newly cloned today: ~/git/cool-retro-term% git branch -v * master f89aeec Merge pull request #512 from timm0e/patch-1 ~/git/cool-retro-term% git submodule status 48274c75660e28d44af7c195e79accdf1bd44963 qmltermwidget (0.6.0-323-g48274c7) and ~/git/cool-retro-term-unstable% git branch -v * unstable cdbe8d7 Bump version code. ~/git/cool-retro-term-unstable% git submodule status ddd71acdd4d5f6a8f764daec679eadcc100e4d9a qmltermwidget (0.6.0-322-gddd71ac)
kent-engstrom commented 2019-06-14 15:37:29 +02:00 (Migrated from github.com)

Tried again on Fedora 30, with stable and unstable versions. Control + Space still does not work. Did some more troubleshooting this time (on unstable), and looked at the commit in qmltermwidget that should fix this,
``
commit 490eeaf195cd5764a3798c2a2340ced648db4526
Author: Filippo Scognamiglio flscogna@gmail.com
Date: Fri Apr 3 19:01:43 2015 +0200

Fix CTRL+SPACE behaviour on QT5.

diff --git a/lib/KeyboardTranslator.cpp b/lib/KeyboardTranslator.cpp
index 7530421..46f035c 100644
--- a/lib/KeyboardTranslator.cpp
+++ b/lib/KeyboardTranslator.cpp
@@ -718,7 +718,7 @@ QByteArray KeyboardTranslator::Entry::unescape(const QByteArray& input) const
}

        if ( escapedChar )
  •           result.replace(i,charsToRemove,replacement);
    
  •           result.replace(i,charsToRemove,replacement,1);
       }
    
    }

diff --git a/lib/Vt102Emulation.cpp b/lib/Vt102Emulation.cpp
index 3343571..da2b3d7 100644
--- a/lib/Vt102Emulation.cpp
+++ b/lib/Vt102Emulation.cpp
@@ -953,7 +953,7 @@ void Vt102Emulation::sendKeyEvent( QKeyEvent* event )
}
else if ( !entry.text().isEmpty() )
{

  •        textToSend += _codec->fromUnicode(entry.text(true,modifiers));
    
  •        textToSend += entry.text(true,modifiers);
       }
       else if((modifiers & Qt::ControlModifier) && event->key() >= 0x40 && event->key() < 0x5f) {
           textToSend += (event->key() & 0x1f);
    

``
It seems the Vt102Emulation.cpp part is later changed so the line reads

        textToSend += _codec->fromUnicode(QString::fromUtf8(entry.text(true,modifiers)));

and that stops Ctrl-Space from working. Testing to change it back to

         textToSend += entry.text(true,modifiers);

make Ctrl-Space work again, but I'm scared of what other consequences it could have.

Tried again on Fedora 30, with stable and unstable versions. Control + Space still does not work. Did some more troubleshooting this time (on unstable), and looked at the commit in qmltermwidget that should fix this, `` commit 490eeaf195cd5764a3798c2a2340ced648db4526 Author: Filippo Scognamiglio <flscogna@gmail.com> Date: Fri Apr 3 19:01:43 2015 +0200 Fix CTRL+SPACE behaviour on QT5. diff --git a/lib/KeyboardTranslator.cpp b/lib/KeyboardTranslator.cpp index 7530421..46f035c 100644 --- a/lib/KeyboardTranslator.cpp +++ b/lib/KeyboardTranslator.cpp @@ -718,7 +718,7 @@ QByteArray KeyboardTranslator::Entry::unescape(const QByteArray& input) const } if ( escapedChar ) - result.replace(i,charsToRemove,replacement); + result.replace(i,charsToRemove,replacement,1); } } diff --git a/lib/Vt102Emulation.cpp b/lib/Vt102Emulation.cpp index 3343571..da2b3d7 100644 --- a/lib/Vt102Emulation.cpp +++ b/lib/Vt102Emulation.cpp @@ -953,7 +953,7 @@ void Vt102Emulation::sendKeyEvent( QKeyEvent* event ) } else if ( !entry.text().isEmpty() ) { - textToSend += _codec->fromUnicode(entry.text(true,modifiers)); + textToSend += entry.text(true,modifiers); } else if((modifiers & Qt::ControlModifier) && event->key() >= 0x40 && event->key() < 0x5f) { textToSend += (event->key() & 0x1f); `` It seems the Vt102Emulation.cpp part is later changed so the line reads textToSend += _codec->fromUnicode(QString::fromUtf8(entry.text(true,modifiers))); and that stops Ctrl-Space from working. Testing to change it back to textToSend += entry.text(true,modifiers); make Ctrl-Space work again, but I'm scared of what other consequences it could have.
Swordfish90 commented 2019-06-16 19:25:52 +02:00 (Migrated from github.com)

Hi @kent-engstrom , thank you very much for your investigation, you are right. This was something I missed while merging back the latest changes in qtermwidget, the fix we had in place was correct.
Just to make sure I also checked the current konsole implementation and they are doing something along these lines.

Feel free to open a pull request so I can give you credit for it (otherwise I will patch it the next days).

Hi @kent-engstrom , thank you very much for your investigation, you are right. This was something I missed while merging back the latest changes in qtermwidget, the fix we had in place was correct. Just to make sure I also checked the current konsole implementation and they are doing something along these lines. Feel free to open a pull request so I can give you credit for it (otherwise I will patch it the next days).
kent-engstrom commented 2019-06-17 11:26:51 +02:00 (Migrated from github.com)

Pull Request no 24 for Swordfish90/qmltermwidget.

Pull Request no 24 for Swordfish90/qmltermwidget.
Swordfish90 commented 2019-06-19 09:37:37 +02:00 (Migrated from github.com)

Thank you again @kent-engstrom... This was merged yesterday, master is fixed now.

Thank you again @kent-engstrom... This was merged yesterday, master is fixed now.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: seeseemelk/cool-retro-term#165
No description provided.