vscode: Debug console auto-completion interferes and messes up my command when it shouldn't (AKA return key grabbed from me when it shouldn't be))

  • VSCode Version: 1.50.0
  • OS Version: Fedora 32 / Linux x64 5.8.7

Steps to Reproduce:

  1. See video below, not sure how to do this in a minimal project.
  2. Basically I typed (int) and then pressed enter to run the command
  3. What happens is that the auto completion thinks I want to use it even though I am in the middle of the line, and clearly the insert is plain broken anyway (while what I typed does make sense & runs):

vscodebug

I think there is just a fundamental issue of defaulting to “Enter” -> triggers auto completion in an input box where clearly Enter is expected to just run the command. That seems unfortunate to me, I would suggest to limit auto completion to tab or shift-enter by default please (and then to simply add a remark like “Press Shift+Enter to pick” into the auto complete pop up box). Convenience is nice and all, but if I’m just blindly entering a command or a line of code then IMHO the auto completion shouldn’t just drop things that don’t run in the middle of what I am typing. It’s frustrating for me to stare at the screen and babysit things not getting in the way when I just plain type 😳 and I imagine maybe it’s not just me

Does this issue occur when all extensions are disabled? I don’t know, because the debugger isn’t really usable without the extension to enable it. I suppose this could also be a problem with the clangd extension, but I assumed the auto-completion handling is in the end likely triggered in the editor.

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 5
  • Comments: 22 (7 by maintainers)

Commits related to this issue

Most upvoted comments

After some pondering I came to the following solution:

  • We will not accept suggestion in the repl input on Enter. Only on Tab and Shift+Enter
  • To educate users about this change we will always render the status bar for the Repl suggest widget

I do not like adding obscure settings to control this that would only make people that are following this issue happy. Due to that I made this general change which I think will improve the experience for everybody.

As for the idea to have the history per session: the history is already per workspace. So this would help only for “advanced” scenario of having multiple different debug sessions in a same workspace. I think this idea make sense but I have not tackled this as part of this issue, please open a new issue for this and ping me on it. Or would you like the history to be cleared between session restarts? Thanks

Thanks to @jrieken for fixing the suggest status bar keybindings rendering via https://github.com/microsoft/vscode/commit/84323a804695ab15b8f3796412f20ef97771a39f

Please try it out with VS Code insiders from tomorrow and let me know what you think.

Adding verification needed as I would like this to be tested for 15mins at least. If there are volunteers please let me know.

Screenshot 2021-06-30 at 17 45 03

I understand the issue you are facing. However I would not change the default. I believe most of the user expect enter to pick the suggest item. For example chrome dev tools behaves the same way.

However I will leave this issue open to gather more user feedback and potentially change this in the future. Thank you

I would also love to see a refinement of the debug.console.historySuggestions setting. Instead of on/off I would like to have “on but scoped to session”, e.g history should be limited to a debug session and not globally.

@isidorn above you said:

However I will leave this issue open to gather more user feedback and potentially change this in the future.

IMO enough user feedback has been gathered to address this pain point.

We can either respect this editor setting:

2021-06-10_11-38-52

or duplicate the setting for the debug console.

I’d prefer the latter approach.

I would love to see this resolved as well – it is an almost daily aggravation for me.

I’m a bit skeptical about the specific choice of Shift+Enter though, since Shift+Enter usually means “create a line-break, do not submit” in most other programs.

I mean it feels like a step up for sure, but as a user I would expect it to “just work” like the suggestion widget in the text editor, unless specifically configured otherwise.

  1. Is there a way to create a line break without submitting in the debug console?

It sounds like that would be an issue, but there’s a suggestWidgetVisible context for When expressions for keybindings, which may work.

@weinand I’d also suggest reconsidering the defaults for these settings on fresh VS Code installs, as suggested by me here #108536 . why does the default have to be “cannot type properly” for all things that don’t end in semicolons, in something that at the end of the day is a text editor? (regarding doesn’t end in semicolons: that, turns out, outside of a few specific languages is a huge amount of things. Python exists after all)

This is extremely frustrating and forces me to press escape before pressing enter each time and makes the debug console almost unusable. Does anyone actually want the current behaviour?