-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
Add Enable/Disable actions alongside "Toggle pane read-only mode" #14415
Comments
This is such a reasonable and well written proposal, I can't help but say "sure, why not". The code wouldn't be hard to write (just a lot of plumbing) nor maintain. |
@zadjii-msft I think I am confident to be able to contribute to this. Would be my first contribution so bare with while I figure things out! |
Absolutely, go for it! Lemme know if you need any pointers.
|
Changes made in #14995 Working locally - just need to update docs and what not |
Added documentation in MicrosoftDocs/terminal#645 |
## Summary of the Pull Request PR adds functionality to enable or disable readOnly mode within panes. This functionality is different to toggling as if you call the same functionality twice, it will not toggle between states. ## References and Relevant Issues - Closes #14415 - Documentation MicrosoftDocs/terminal#645 ## Validation Steps Performed - Checked readOnly is enabled when command triggered - Checked readOnly is enabled when command triggered while read only already enabled - Checked readOnly is disabled when command triggered while read only is enabled - Checked readOnly stays disabled when command triggered while read only is disabled - Checked above with multiple tabs and split panes ## PR Checklist - [ ] Closes #14415 - [X] Tests added/passed - [x] Documentation updated - If checked, please file a pull request on [our docs repo](https://github.com/MicrosoftDocs/terminal) and link it here: MicrosoftDocs/terminal#645 - [X] Schema updated (if necessary) --------- Co-authored-by: Mike Griese <migrie@microsoft.com>
## Summary of the Pull Request PR adds functionality to enable or disable readOnly mode within panes. This functionality is different to toggling as if you call the same functionality twice, it will not toggle between states. ## References and Relevant Issues - Closes #14415 - Documentation MicrosoftDocs/terminal#645 ## Validation Steps Performed - Checked readOnly is enabled when command triggered - Checked readOnly is enabled when command triggered while read only already enabled - Checked readOnly is disabled when command triggered while read only is enabled - Checked readOnly stays disabled when command triggered while read only is disabled - Checked above with multiple tabs and split panes ## PR Checklist - [ ] Closes #14415 - [X] Tests added/passed - [x] Documentation updated - If checked, please file a pull request on [our docs repo](https://github.com/MicrosoftDocs/terminal) and link it here: MicrosoftDocs/terminal#645 - [X] Schema updated (if necessary) --------- Co-authored-by: Mike Griese <migrie@microsoft.com> (cherry picked from commit 2acdc9d) Service-Card-Id: 89002012 Service-Version: 1.17
Description of the new feature/enhancement
Two additional terminal actions:
Enable pane read-only mode
Disable pane read-only mode
Reasoning
I make use of the Read-Only mode occasionally, usually whenever I have multiple terminal windows open and a long-running command running in one which prevents me from accidentally hitting "Ctrl+C" in the unintended window.
Read-Only mode has the nice feature of showing a padlock icon next to the pane's title whenever Read-Only mode is active, but of course this helpful hint is not visible if the terminal is in Full-Screen mode.
Whenever that scenario (toggling read-only mode in a fullscreen window) comes up for me, I'll usually just hit
space
, which will show a pop-up if the pane is in Read-Only mode, and if no pop-up is shown, I'll know to run the action to toggle read-only mode.I think it would be helpful to have the 2 actions I proposed above, neither of which should care whether Read-Only mode is already active or not, and then internally either perform the toggle of read-only mode, or noop. These actions would provide a more assured method of setting the intended mode for a pane and don't need to prompt the user.
Proposed technical implementation details (optional)
My current workaround is a custom terminal action (defined in my
settings.json
):This gives action provides an indication of the Read-Only mode state of a pane by forcefully showing the "Read-only mode is enabled" pop-up after sending a
space
, and if nothing happens when I run the action, I know I need to run it again.I couldn't find any mechanism of setting/retrieving the current state of a pane's read-only mode, so I wasn't able to figure out an alternative solution for myself (for instance, defining a PowerShell function to check/toggle the read-only mode state, which could maybe be used in a Terminal action)
Given that the "Toggle pane read-only mode" is a pretty stable feature, it may be pretty simple to add these additional actions within the source code here. I'll give it my best shot and report back but I wanted to see if anyone had an opinion/suggestion as well.
The text was updated successfully, but these errors were encountered: