krish-r / vscode-toggle-terminal

VS Code extension that adds a toggle icon (shortcut) in the status bar.
https://marketplace.visualstudio.com/items?itemName=krish-r.vscode-toggle-terminal
MIT License
6 stars 3 forks source link

Hover preview to see what terminals are running #4

Open mlntr opened 3 months ago

mlntr commented 3 months ago

Hi this is a nice little extension (I tried requesting a similar feature in VSCode but sadly didn't get enough support)
Currently hovering on the extension's icon shows "Toggle Terminal" in a popup: Screenshot from 2024-05-26 13-49-55

If you open multiple terminals in VS Code, there will be an icon and name for each one: Screenshot from 2024-05-26 13-41-33

I have an idea for an extra feature: It could be more useful if this extension showed this preview in the hover popup (maybe even allow user to click one in the popup if that's possible/not too much)

krish-r commented 3 months ago

Hello,

Thanks for the suggestion.

I've published v0.0.7, this adds a setting (vscode-toggle-terminal.listNames) to display terminal name on (tooltip) hover.

Screenshot from 2024-05-27 00-16-13

VS Code's Status Bar Item API only supports String / MarkdownString tooltips, so unfortunately user interactions or multi-icon support (like the ones in your screenshot) is not possible at this moment.

Also, due to VS Code's Event API limitations, name might not update in some cases until there's some interaction - for ex. using the toggle, switching active terminals / creating new terminals, etc.. (This will be noticeable when opening applications in the terminal - for ex. If you open nvim it'll still show bash until there's some interaction.)

mlntr commented 3 months ago

Unfortunate that there's an event API limitation, but still a useful feature imo even if it's not always live

Hopefully there will soon be multi-icon support - makes it easier especially to differentiate tasks that are running vs other terminal processes

btw a very minor bug: when switching the order of a terminal tabs, the position in the hover list doesn't change

krish-r commented 3 months ago

btw a very minor bug: when switching the order of a terminal tabs, the position in the hover list doesn't change

Thanks for testing it out.

I had a quick look at VS Code's Window & Terminal APIs and looks like there isn't one to provide the latest order.