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

Allow consumers to specify a set of key sequences to not be handled by the terminal and bubble up instead #152

Closed
Tyriar opened this issue Jun 28, 2016 · 5 comments
Labels
type/enhancement Features or improvements to existing features type/proposal A proposal that needs some discussion before proceeding

Comments

@Tyriar
Copy link
Member

Tyriar commented Jun 28, 2016

See microsoft/vscode#7269 for context.

Some users want F1 to not be consumed by the temrinal and instead be bubbled up to be handled by the application (to toggle the command palette). I can see this being useful for other keys as well depending on specific the use case.

@parisk parisk added type/enhancement Features or improvements to existing features type/proposal A proposal that needs some discussion before proceeding labels Jun 29, 2016
@parisk
Copy link
Contributor

parisk commented Jun 29, 2016

Sounds like a sane proposal. We could create a more declarative key binding API and export all current key handling to add-on like objects.

@parisk
Copy link
Contributor

parisk commented Jun 29, 2016

This way you will be able to choose which of them to include in your "xterm bundle".

@TDaglis
Copy link
Contributor

TDaglis commented Jun 29, 2016

As an alternative (or as a temporary) solution, the application could catch the key sequences on capturing instead of bubbling.

@protamail
Copy link

protamail commented Jul 10, 2016

This is already pretty easy to achieve with very small modifications. The existing "keydown" event should be emitted with additional parameter "result". And its emit call should be moved up before if (result.cancel) and if (!result.key) blocks. Then the "keydown" handler could inspect event.keyCode and result.key and e.g. set result.key = "" to ignore key and let it bubble, or also set result.cancel = true to prevent bubble as well. It could even override result.key with a different escape sequence if required. The websocket sending code would still reside in the catch-all "data" handler...

@Tyriar
Copy link
Member Author

Tyriar commented Sep 17, 2016

This duplicates #118

@Tyriar Tyriar closed this as completed Sep 17, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/enhancement Features or improvements to existing features type/proposal A proposal that needs some discussion before proceeding
Projects
None yet
Development

No branches or pull requests

4 participants