Dear list,
I'd like to use some bash-related shortcuts in Geany's embedded VTE terminal emulator.
Like: * ctrl-l (clear terminal) * ctrl-r (reverse-i-search) * ctrl-k (remove from cursor to EOL) * ctrl-u (remove from cursor to BOL) * etc...
Geany overrides some of these shortcuts by default (examples: ctrl-l = goto line nr, ctrl-r = reload)
Is there a way to disable all Geany shortcuts while the VTE window has focus?
-H-
On Mon, 24 Sep 2007 15:02:00 +0200, Harold Aling h.aling@home.nl wrote:
Dear list,
I'd like to use some bash-related shortcuts in Geany's embedded VTE terminal emulator.
Like:
- ctrl-l (clear terminal)
- ctrl-r (reverse-i-search)
- ctrl-k (remove from cursor to EOL)
- ctrl-u (remove from cursor to BOL)
- etc...
Geany overrides some of these shortcuts by default (examples: ctrl-l = goto line nr, ctrl-r = reload)
Is there a way to disable all Geany shortcuts while the VTE window has focus?
See the attached patch. It disabled all defined keybindings if the VTE is active. But this is only a dirty 1minute hack ;-). There are still some problems: - it only works for shortcuts which are not bound to a menu entry(e.g. you have Ctrl-r for "reload file" which has a menu item where ctrl-r is displayed, then it won't work) - with the patch, there is no way to get out of the VTE using the "switch to editor/search bar/scribble/..." keybindings
To get it into Geany we need some smarter code, but for now the patch might help.
Regards, Enrico
On 24/09/07 15:39:01, Enrico Tröger wrote:
On Mon, 24 Sep 2007 15:02:00 +0200, Harold Aling h.aling@home.nl wrote:
I'd like to use some bash-related shortcuts in Geany's embedded VTE terminal emulator.
Like:
- ctrl-l (clear terminal)
- ctrl-r (reverse-i-search)
- ctrl-k (remove from cursor to EOL)
- ctrl-u (remove from cursor to BOL)
- etc...
[...] To get it into Geany we need some smarter code, but for now the patch might help.
These should now work in SVN, even if they are menu accelerators. I also enabled some other common bash Ctrl-[a-z] shortcuts, e.g. Ctrl-W for delete last word. It is slightly hackish in that the menubar is temporarily disabled, so you see flickering - but IMO it's worth it for the bash shortcuts. Other Geany commands that don't conflict with bash should still work.
Any SVN users, please test this and post any comments.
(Unfortunately there is still a problem with Ctrl-Shift-[CV] for copy/ paste - probably some special setup for the VTE widget is needed, because it now receives those commands).
Regards, Nick
On Wed, 26 Sep 2007 17:37:58 +0100, Nick Treleaven nick.treleaven@btinternet.com wrote:
On 24/09/07 15:39:01, Enrico Tröger wrote:
On Mon, 24 Sep 2007 15:02:00 +0200, Harold Aling h.aling@home.nl wrote:
I'd like to use some bash-related shortcuts in Geany's embedded VTE terminal emulator.
Like:
- ctrl-l (clear terminal)
- ctrl-r (reverse-i-search)
- ctrl-k (remove from cursor to EOL)
- ctrl-u (remove from cursor to BOL)
- etc...
[...] To get it into Geany we need some smarter code, but for now the patch might help.
These should now work in SVN, even if they are menu accelerators. I also enabled some other common bash Ctrl-[a-z] shortcuts, e.g. Ctrl-W for delete last word. It is slightly hackish in that the menubar is temporarily disabled, so you see flickering - but IMO it's worth it for the bash shortcuts. Other Geany commands that don't conflict with bash should still work.
Any SVN users, please test this and post any comments.
Ctrl-L still opens the 'Goto line #' popup... Ctrl-R sometimes alse shows up as ^R, so I think that your implementation is somewhat buggy... ;(
-H-
PS: Is there a way to toggle the VTE (with input focus change) with the keyboard? I could only find a toggle for the message window, but that doesn't give focus to the VTE widget.
On 28/09/07 08:17:22, Harold Aling wrote:
Ctrl-L still opens the 'Goto line #' popup... Ctrl-R sometimes alse shows up as ^R, so I think that your implementation is somewhat buggy... ;(
Ctrl-L should work now. I hadn't disabled the editor's popup menu. I can't reproduce the problem with Ctrl-R - have you set it to something other than Reload? If the problem persists with latest SVN, can you find out when it works and when it doesn't?
Also, I added a hidden pref in keybindings.conf to disable this - but should it be off by default? (After 0.12 I'll add a Prefs dialog option).
Regards, Nick
On Fri, 28 Sep 2007 12:06:45 +0100, Nick Treleaven nick.treleaven@btinternet.com wrote:
On 28/09/07 08:17:22, Harold Aling wrote:
Ctrl-L still opens the 'Goto line #' popup... Ctrl-R sometimes alse shows up as ^R, so I think that your implementation is somewhat buggy... ;(
Ctrl-L should work now. I hadn't disabled the editor's popup menu.
Check!
I can't reproduce the problem with Ctrl-R - have you set it to something other than Reload? If the problem persists with latest SVN, can you find out when it works and when it doesn't?
I'm also unable to reproduce it, so forget about this for now...
I have an other issue, though. Ctrl-c resets the terminal instead of just aborting something?
Also, I added a hidden pref in keybindings.conf to disable this - but should it be off by default? (After 0.12 I'll add a Prefs dialog option).
off = don't kill geany shortcuts while VTE has focus?
or
off = don't override Geany shortcuts while VTE has focus?
-H-
On 28/09/07 12:45:59, Harold Aling wrote:
On Fri, 28 Sep 2007 12:06:45 +0100, Nick Treleaven nick.treleaven@btinternet.com wrote: I have an other issue, though. Ctrl-c resets the terminal instead of just aborting something?
This was added before when bash keybindings were overridden to kill a misbehaving command, but now it might not be necessary - I'll check this, and probably remove it.
Also, I added a hidden pref in keybindings.conf to disable this -
but
should it be off by default? (After 0.12 I'll add a Prefs dialog option).
I should have been clearer - the preference is to enable bash keybindings in the VTE, and is currently on by default. But this may be annoying for some users - is this a reasonable default?
Regards, Nick
On 28/09/07 13:18:44, Nick Treleaven wrote:
On 28/09/07 12:45:59, Harold Aling wrote:
On Fri, 28 Sep 2007 12:06:45 +0100, Nick Treleaven nick.treleaven@btinternet.com wrote: I have an other issue, though. Ctrl-c resets the terminal instead
of
just aborting something?
This was added before when bash keybindings were overridden to kill a misbehaving command, but now it might not be necessary - I'll check this, and probably remove it.
Ctrl-[CD] should now work as expected, when bash keys are enabled (the hidden pref is now a [VTE] setting in geany.conf, enable_bash_keys, which defaults to true).
Regards, Nick
On Wed, 03 Oct 2007 12:34:28 +0100, Nick Treleaven nick.treleaven@btinternet.com wrote:
On 28/09/07 13:18:44, Nick Treleaven wrote:
On 28/09/07 12:45:59, Harold Aling wrote:
On Fri, 28 Sep 2007 12:06:45 +0100, Nick Treleaven nick.treleaven@btinternet.com wrote: I have an other issue, though. Ctrl-c resets the terminal instead
of
just aborting something?
This was added before when bash keybindings were overridden to kill a misbehaving command, but now it might not be necessary - I'll check this, and probably remove it.
Ctrl-[CD] should now work as expected, when bash keys are enabled (the hidden pref is now a [VTE] setting in geany.conf, enable_bash_keys, which defaults to true).
Confirmed, thanx!
Now if only "Switch to VTE" would be a toggle[1] function I'd be an even more happy user...
-H-
[1] Switch to VTE if message window is open, hide message window if VTE is already open
On 03/10/07 12:37:06, Harold Aling wrote:
Confirmed, thanx!
Now if only "Switch to VTE" would be a toggle[1] function I'd be an even more happy user... [...] [1] Switch to VTE if message window is open, hide message window if VTE is already open
I forgot to comment on this in the other mail. I'm not sure about that - you can already use Switch to VTE when the message window is hidden, then use the Toggle Message Window command to hide it. Sometimes I press the Switch to VTE command when it's already focused - perhaps that isn't important, but then again, perhaps the principle of least surprise is best.
Regards, Nick
On Wed, 03 Oct 2007 12:34:28 +0100, Nick Treleaven nick.treleaven@btinternet.com wrote:
On 28/09/07 13:18:44, Nick Treleaven wrote:
On 28/09/07 12:45:59, Harold Aling wrote:
On Fri, 28 Sep 2007 12:06:45 +0100, Nick Treleaven nick.treleaven@btinternet.com wrote: I have an other issue, though. Ctrl-c resets the terminal instead
of
just aborting something?
This was added before when bash keybindings were overridden to kill a misbehaving command, but now it might not be necessary - I'll check this, and probably remove it.
Ctrl-[CD] should now work as expected, when bash keys are enabled (the hidden pref is now a [VTE] setting in geany.conf, enable_bash_keys, which defaults to true).
Confirmed, thanx!
Now if only "Switch to VTE" would be a toggle[1] function I'd be an even more happy user...
-H-
[1] Switch to VTE if message window is open, hide message window if VTE is already open
On Mon, 24 Sep 2007 16:39:01 +0200, Enrico Tröger enrico.troeger@uvena.de wrote:
On Mon, 24 Sep 2007 15:02:00 +0200, Harold Aling h.aling@home.nl wrote:
Is there a way to disable all Geany shortcuts while the VTE window has focus?
See the attached patch. It disabled all defined keybindings if the VTE is active. But this is only a dirty 1minute hack ;-). There are still some problems:
- it only works for shortcuts which are not bound to a menu entry(e.g.
you have Ctrl-r for "reload file" which has a menu item where ctrl-r is displayed, then it won't work)
- with the patch, there is no way to get out of the VTE using the
"switch to editor/search bar/scribble/..." keybindings
To get it into Geany we need some smarter code, but for now the patch might help.
Regards, Enrico
I'm sorry, but I have to 'reopen' this issue...
Not only does copy/paste not work on the VTE, once I've opened 'nano' in VTE, I can't exit it with CTRL-X, and thus I can't commit anything to svn...
-H-
On 18/10/07 09:39:15, Harold Aling wrote:
I'm sorry, but I have to 'reopen' this issue...
Not only does copy/paste not work on the VTE, once I've opened 'nano' in VTE, I can't exit it with CTRL-X, and thus I can't commit anything to svn...
The way I did it, it just scans a list of common bash shortcuts (see check_vte() in keybindings.c), it doesn't let the VTE decide whether it wants to interpret the keybinding or not. I tried to do that first, but I couldn't get it to work. That would probably be the ideal solution, although probably the switch to editor command should always override the VTE.
I'm not sure about the copy/paste problem, probably there's some special setup needed that e.g. Terminal does but Geany doesn't.
Regards, Nick
On 18/10/07 09:39:15, Harold Aling wrote:
On Mon, 24 Sep 2007 16:39:01 +0200, Enrico Tröger enrico.troeger@uvena.de wrote:
On Mon, 24 Sep 2007 15:02:00 +0200, Harold Aling h.aling@home.nl wrote:
Is there a way to disable all Geany shortcuts while the VTE window has focus?
I'm sorry, but I have to 'reopen' this issue...
[...] once I've opened 'nano' in VTE, I can't exit it with CTRL-X, and thus I can't commit anything to svn...
This should work now in current SVN. Instead of checking a whitelist of common bash shortcuts, the VTE now interprets all shortcuts that are not listed as a Focus command in the keybindings dialog (so by default, everything except a few Fn keys).
Regards, Nick