-
Notifications
You must be signed in to change notification settings - Fork 15
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
FR: focus specific terminal; create new terminal with options; optionally reuse specific terminal for runInTerminal
;
#45
Conversation
• Added `*.code-workspace`.
• Also refactored `runInTerminal` 'reuse' property to specify newest or oldest.
Not sure about the purpose of Like, imagine I'm a user reading the REAMDE file. There are 2 similar commands:
|
It offers the ability to create a terminal with a given name / icon color / cwd without specifically sending text to it immediately. I only included it originally to avoid duplicating code between Regarding documentation, I wasn't sure what to put for a comment after |
Still not convinced of the need of If If any feature cannot be merged into |
Sure I'll have a go, just think the functionality is worth keeping. It might sit better within Anyway on a related note, I realised that my current strategy for differentiating non-task terminals falls down if |
Maybe "target" or "which". |
• Replaces `revealTerminalCommand` & `createTerminalCommand`
Had another crack at this today, works more robustly now. |
I think codicon code should be a separate PR. And I have plans to merge Codicon Names into this extension. |
Although, it's probably fine. The icons don't change that often. |
Could scrub it in favour of an generalised string - although it would make it more difficult to check that the icon in |
No need to change. I'll review it this week. |
"iconColor" doesn't work... "commands.focusTerminal_04": {
"command": "commands.focusTerminal",
"args": {
"name": "random",
"which": "create new",
"icon": "calendar",
"iconColor": "terminal.ansiRed"
}
} It blinks with red and then - goes back to default color. |
I'm on 1.76. It's probably my powershell profile ... or not. |
I've only got access to zsh / bash, but it works fine with either. Yeah I dunno I'm stumped - I've tried hard to break it but it works every time.
... even with stupid stuff like:
(I realise it's not necessarily of help - just want to prove that I did a bit more due diligence than earlier in the week!) |
Color is probably like 95% this issue microsoft/vscode#167643 (only affects Windows & Mac OS) |
Weird that there's reports of it on both Mac and Windows but it must be pretty esoteric 🤔 (I'm on Mac). |
Looks great 👍. I changed "which" to "target". And haven't tested icons. |
Good stuff 👍. Hopefully vscode fixes the issue you linked soon so people can get the full benefit - but in the meantime at least no more accidentally typing random text into files every 5 minutes when I try to focus the terminal and run shell commands after a task has run 🤞. |
Currently, VSCode doesn't seem to offer any way of directly focusing a user-initiated terminal (ie. one that hasn't come from a task) without using
workbench.action.quickOpenTerm
(and selecting appropriately) or multiple keyboard shortcuts / mouseclicks. I've attempted to address this, and in the course of doing so hopefully opened up some additional potentially useful options, namely:new command:
revealTerminal
new command:
createTerminal
additional feature for command:
runInTerminal
BACKGROUND / RATIONALE: After coming up against microsoft/vscode#125573 I began using the
runInTerminal
action generally as a replacement forworkbench.action.terminal.sendSequence
. However there is then no direct way to run further related shell commands later on within that same terminal, without navigating specifically to it and either entering the shell commands manually or runningworkbench.action.terminal.sendSequence
. To quote the OP in the closed issue above:These features attempt to provide a means to do all this within a single command / sequence / keybinding. Originally I had only sought to refactor
runInTerminal
, but along the way it made sense to allow focusing a specific terminal as a separate command. Then in due course it also seemed useful to allow creating a terminal with specified options - (this renames the new terminal after creation because the only way of differentiating a user-initiated vs task-initiated terminal AFAIK is that task-initiated terminals always have acreationOptions.name
).Hopefully this is of interest / use.