-
Notifications
You must be signed in to change notification settings - Fork 28.8k
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
Migrate Terminal Panel to ViewPane #90252
Conversation
I don't know how to move it to the viewlet, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great, thanks for this!
@@ -289,7 +289,7 @@ export class TerminalTaskSystem implements ITaskSystem { | |||
return false; | |||
} | |||
const activeTerminalInstance = this.terminalService.getActiveInstance(); | |||
const isPanelShowingTerminal = this.panelService.getActivePanel()?.getId() === TERMINAL_PANEL_ID; | |||
const isPanelShowingTerminal = this.panelService.getActivePanel()?.getId() === TERMINAL_VIEW_ID; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this need to change to isViewShowingTerminal
and views service instead?
@@ -964,7 +964,7 @@ export class TerminalInstance extends Disposable implements ITerminalInstance { | |||
|
|||
private _refreshSelectionContextKey() { | |||
const activePanel = this._panelService.getActivePanel(); | |||
const isActive = !!activePanel && activePanel.getId() === TERMINAL_PANEL_ID; | |||
const isActive = !!activePanel && activePanel.getId() === TERMINAL_VIEW_ID; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Again should this not use views service?
Registry.as<IViewsRegistry>(ViewContainerExtensions.ViewsRegistry).registerViews([{ | ||
id: TERMINAL_VIEW_ID, | ||
name: nls.localize('terminal', "Terminal"), | ||
canToggleVisibility: false, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No idea what this is meant to drive, I can still right click to toggle the visibility in the panel?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This shall be set to true
unless we do not want terminal to hidden.
const pane = this._viewsService.getActiveViewWithId(TERMINAL_VIEW_ID) as TerminalViewPane; | ||
if (pane) { | ||
pane.hideFindWidget(); | ||
this._findWidgetVisible.reset(); | ||
panel.focus(); | ||
pane.focus(); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This and findNext/findPrevious no longer verify if the terminal is active or not, I guess that's fine though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
getActiveViewWithId only returns the requested view if it is active. so if (pane) is sufficient
Registry.as<IViewsRegistry>(ViewContainerExtensions.ViewsRegistry).registerViews([{ | ||
id: TERMINAL_VIEW_ID, | ||
name: nls.localize('terminal', "Terminal"), | ||
canToggleVisibility: false, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This shall be set to true
unless we do not want terminal to hidden.
You shall enable |
This PR refs #89729