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

Button to enter command #287

Open
justinlaughlin opened this issue Jul 10, 2024 · 4 comments
Open

Button to enter command #287

justinlaughlin opened this issue Jul 10, 2024 · 4 comments

Comments

@justinlaughlin
Copy link
Contributor

It may be nice to have a dedicated button that would then let you type in a command into the terminal, e.g. format. The idea is something similar to : in vim or Ctrl+Shift+P in vscode. : is an unused key at the moment and a potential candidate.

Some keys already require additional user input into the terminal (e.g. F5). Currently this is done using cin >> (ref) but this can lead to GLVis freezing if something erroneous is input (e.g. a string when a number is expected). I have a minimal prompt() function that could maybe be a starting point for input type checking and validation (ref).

For now, the easiest implementation would require inputting the command into the terminal, but eventually it would be nice to be able to directly input the command into the GLVis window.

@v-dobrev
Copy link
Member

@justinlaughlin, it may be more convenient to open a WIP/Draft PR for your branch https://github.com/GLVis/glvis/tree/number-formatting, and have the discussion there -- at least if you think you want to address this topic there. If the topic here will be addressed in a separate branch (or multiple branches), then keeping this separate from the number-formatting branch is okay.

@justinlaughlin
Copy link
Contributor Author

@v-dobrev The number-formatting branch is actually for #260. I think this should be a separate branch/PR. The only reason I mention it is that I implemented the prompt() function and figured it could be useful for the command inputs.

@v-dobrev
Copy link
Member

Here are a few options for the key that opens the "command mode":

  • Esc: not used at the moment, I think.
  • Enter: it is currently used but the command it is bound to is not used so often, so probably not a big issue to change it.
  • Tab: also not used at the moment, I think.

@tzanio
Copy link
Member

tzanio commented Jul 12, 2024

I like all of :, Esc and Tab.

I'd prefer we don't change Enter

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