-
Notifications
You must be signed in to change notification settings - Fork 9.1k
Description
Description of the new feature/enhancement
Two additional terminal actions:
Enable pane read-only modeDisable 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):
"actions": [
{
"name": "Toggle pane read-only mode (w/check)",
"keys": "alt+r",
"command": {
"action": "multipleActions",
"actions": [
{ "action": "toggleReadOnlyMode" },
{ "action": "sendInput", "input": " " }
]
}
},
]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.
Thanks to all the contributors for all the great work you do on this project!
Metadata
Metadata
Assignees
Labels
Type
Projects
Status