This is the mail archive of the gdb-prs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug tui/15163] Vi settings within ~/.inputrc prevent entering/exiting TUI via C-x a


https://sourceware.org/bugzilla/show_bug.cgi?id=15163

Memo Salas <memo.salas at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |memo.salas at gmail dot com

--- Comment #4 from Memo Salas <memo.salas at gmail dot com> ---
This is the workaround I found:

in my ~/.inputrc , I added a line that looks like this:
C-P: tui-switch-mode

i.e. ctrl-p will do the switch.

Then, in gdb's source, in the file gdb/tui/tui.c , I found the call that
normally looks like this:

rl_add_defun ("tui-switch-mode", tui_rl_switch_mode, -1);

and changed the 3rd parameter (i.e. the key) to be a 16. Why 16? it's what the
macro CTRL(X) will do for the letter I want to assign (i.e. ctrl-p in my case).

After that, I can exit in vi-keys out of tui mode by pressing ctrl-p.


So what is the real fix?
It seems to me that a solution will have to do with changing the function
"tui_initialize_readline", which is the one that is being called at startup in
a way that it hardcodes a key of with value -1 to the "tui-switch-mode", so
that the user can provide their own key for it. My question is why is there a
-1 being assigned to that function right now in the first place. Does anybody
know ?

-- 
You are receiving this mail because:
You are on the CC list for the bug.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]