Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request] Vim mode in debugger interface #3384

Open
erikw opened this issue May 24, 2023 · 9 comments
Open

[Feature Request] Vim mode in debugger interface #3384

erikw opened this issue May 24, 2023 · 9 comments

Comments

@erikw
Copy link

erikw commented May 24, 2023

It would be great if fingers used to Vim-like navigation could command the delve debugger TUI e.g. like <esc>kki which would go up to lines in the history and enter insert mode again.

I'm used to this with other repl/debuggers like iPython, IRB, ghci etc.

Is delve using readline for the debugger TUI input? Then this would come for free when having set editing-mode vi in ~/.inputrc (did not work though so I assume not).

@aarzilli
Copy link
Member

This was brought up before #2515

@itaranto
Copy link

itaranto commented Sep 19, 2024

This would be great, but I don't think delve uses readline (that's what reads .inputrc). My guess is that this would require to be implemented from scratch.

Another alternative would be to write a custom client.

@itaranto
Copy link

itaranto commented Oct 18, 2024

I was taking a look at liner which is the library used by delve to implement the prompt.

Like @aarzilli already mentioned, there's an open issue for this. I took a look at the code and it seems implementing a Vi/Vim mode in liner would be huge pain in the ass.

So, I came across this library, which it seems to be a re-implementation of readline but in Go. It looks like it supports a Vim mode.

@aarzilli Have you considered using a different "liner" library?

@itaranto
Copy link

itaranto commented Oct 18, 2024

I just remembered you guys at Delve use a mailing list, I'll try using readline for a bit and maybe I can create a proposal later.

@aarzilli
Copy link
Member

We need ^C and ^Z to deliver signals in a specific way, these aren't tested automatically because we don't know how to write automated tests for it so it would have to be tested manually on every operating system we support (windows, macOS, linux and freebsd) and bugs there can be subtle.
That is to say: switching to a different readline library starts at a severe penalty and this issue isn't exactly bustling.

@aarzilli
Copy link
Member

PS the library you are proposing has no tagged versions, a single importer and no activity for the past 3 years.

@itaranto
Copy link

PS the library you are proposing has no tagged versions, a single importer and no activity for the past 3 years.

Yes, I know. But I looked at the code at it seems to be well structured compared to liner. Also, the author seems to have "extracted" this code from another project of his (murex) which seems to be active.

To be fair, liner hasn't been updated in 3 years either.

@itaranto
Copy link

itaranto commented Oct 18, 2024

Oh, and BTW. The library actually has tagged versions.

I think they don't show up in https://pkg.go.dev/ because of the Go version present in go.mod.

@itaranto
Copy link

itaranto commented Oct 25, 2024

Well, I asked some questions to the Murex developer and it seems https://github.com/lmorg/readline it's not actually being maintained. Not outside Murex anyway.

I found another promising "readline" library which is actively maintained: https://github.com/reeflective/readline. It supports reading form .inputrc , Vim mode, Emacs mode and some other features.

I did a PoC using that one and some (very) basic testing and it seems to work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants