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: global hotkey to re-run last command #2809

Open
Christilut opened this issue Sep 19, 2019 · 5 comments
Open

Feature Request: global hotkey to re-run last command #2809

Christilut opened this issue Sep 19, 2019 · 5 comments
Labels
Area-User Interface Issues pertaining to the user interface of the Console or Terminal Help Wanted We encourage anyone to jump in on these. Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. Product-Terminal The new Windows Terminal.
Milestone

Comments

@Christilut
Copy link

Description of the new feature/enhancement

I would really like to see the ability to bind a global hotkey to repeat the last command in the visible terminal. In essence all it does is: up arrow and enter on the terminal that is visible. Should work even when terminal has no focus since I'm pressing this global hotkey when I'm not in the terminal.

Global hotkeys should be bindable to any key, including special keys such as Scroll Lock, Pause/Break and the Context Menu (the button next to the right CTRL).

iTerm2 has this functionality and no other terminal emulator I've tried has this, on Linux or Windows. I'm sure this is achievable with AutoHotkey but I'd prefer native functionality.

Use case for me:
When testing or running experimental scripts, it is common to rerun your script every time you make a change. It is very productive for me if I don't need to take my hands off the keyboard for this. Personally I would bind this functionality to the "context menu" key (between CTRL and Windows), since I never use that button anyway.

@Christilut Christilut added the Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. label Sep 19, 2019
@ghost ghost added Needs-Tag-Fix Doesn't match tag requirements Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting labels Sep 19, 2019
@zadjii-msft
Copy link
Member

Okay so what you're actually asking for is two things:

  • Global hotkeys that can be bound to Keybindings/ShortcutActions
  • A ShortcutAction that can send input to the terminal

The second part I've already discussed as a part of #2046, so I'm not gonna delve into that too far. I think that's a fine idea, and I'm totally on board. Might need some modification to support VKEYs as input, not just characters, but we can work that out.

The first part might be trickier. It certainly plays into discussion being had in #653. My real question is this: if you have multiple Terminal windows open, which one should the hotkey activate? Do they all get the hotkey's activation?

I'd be worried that this is dependent upon having #2080 and it's associated work finished, as we'll need to have a single manager process to be able to send global hotkeys to, that can then dispatch them to the appropriate Terminal instance.

@zadjii-msft zadjii-msft added Area-User Interface Issues pertaining to the user interface of the Console or Terminal Product-Terminal The new Windows Terminal. labels Sep 19, 2019
@ghost ghost removed the Needs-Tag-Fix Doesn't match tag requirements label Sep 19, 2019
@zadjii-msft zadjii-msft added this to the Terminal Backlog milestone Sep 19, 2019
@zadjii-msft zadjii-msft added the Help Wanted We encourage anyone to jump in on these. label Sep 19, 2019
@Christilut
Copy link
Author

Yes that sounds exactly right.

To answer your question: I'd expect the terminal that was last focused to receive the signal.

There might be use cases for sending the signal to all terminals, perhaps this can be a setting. But I think it would be intuitive to send it to the last focused terminal by default.

@DHowett-MSFT DHowett-MSFT removed the Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting label Sep 19, 2019
@nofunatall
Copy link

How would this work if you have a heavily modified bash profile?
i.e you've changed what up arrow does

@Christilut
Copy link
Author

If the terminal can just send in the up arrow key command then it's up to bash to decide what to do with it.
I think if a user modifies their bash like this then they would expect this global hotkey to execute whatever normally happens when they physically press the up arrow button.

But this would be configurable in whatever way the user requires with #2046

@fishzle
Copy link

fishzle commented Feb 15, 2020

Are there any concerns with input-stealing? Or focus-stealing?
I'm thinking about how this feature sounds similar to the magic sysrq key in linux.
Another thought is that in a single-user environment, it's possibly safe, but in a multi-user/VM/docker environment, could this be unsafe?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-User Interface Issues pertaining to the user interface of the Console or Terminal Help Wanted We encourage anyone to jump in on these. Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. Product-Terminal The new Windows Terminal.
Projects
None yet
Development

No branches or pull requests

5 participants