From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 114093 invoked by alias); 5 Jun 2015 02:11:26 -0000 Mailing-List: contact gdb-prs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-prs-owner@sourceware.org Received: (qmail 113994 invoked by uid 48); 5 Jun 2015 02:11:25 -0000 From: "memo.salas at gmail dot com" To: gdb-prs@sourceware.org Subject: [Bug tui/15163] Vi settings within ~/.inputrc prevent entering/exiting TUI via C-x a Date: Fri, 05 Jun 2015 02:11:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: tui X-Bugzilla-Version: 7.5 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: memo.salas at gmail dot com X-Bugzilla-Status: WAITING X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2015-q2/txt/msg00385.txt.bz2 https://sourceware.org/bugzilla/show_bug.cgi?id=15163 Memo Salas changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |memo.salas at gmail dot com --- Comment #4 from Memo Salas --- 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.