Repository navigation
Fix #8132. Open folder in integrated terminal. - #30354
Conversation
c2fa180 to
1234133
Compare
| } | ||
|
|
||
| this.terminalService.openTerminal(pathToOpen); | ||
| const configuration = this.configurationService.getConfiguration<ITerminalConfiguration>(); |
There was a problem hiding this comment.
I think we actually want to make this decision in ExplorerViewerActionContributor, OpenConsoleAction is an action on the external/native terminal right now. Currently having terminal.terminaKind as "integrated" would make ctrl+shift+c behave similar to ctrl+` by creating and showing a new terminal - we want both to be able to be used at the same time.
There was a problem hiding this comment.
Nice catch, addressed.
|
Now we register Open in Terminal/Integrated Terminal in Files part and put corresponding configuration in Files part as well. |
| ) { | ||
| super(id, label, editorService, contextService, historyService); | ||
|
|
||
| this.order = 49; // Allow other actions to position before or after |
There was a problem hiding this comment.
Can be pulled into AbstarctOpenInTerminalAction?
There was a problem hiding this comment.
Addressed.
|
Benjamin Pasero (@bpasero) please review the changes in fileActions and the new Also because I really feel this belongs in the File Explorer category as the functionality is contained within that component: |
Benjamin Pasero (bpasero)
left a comment
There was a problem hiding this comment.
Peng Lyu (@rebornix) Daniel Imms (@Tyriar) guys, we can do better :). The explorer code is now sprinkled with dependencies to parts/execution, does that make any sense? The way it used to be was correct: the terminal part would contribute into the explorer part and not force a dependency to the explorer. The explorer should only be concerned about managing and showing files. I have updated https://github.com/Microsoft/vscode/wiki/Code-Organization#workbench-parts
| import { KeyMod, KeyChord, KeyCode } from 'vs/base/common/keyCodes'; | ||
| import { OpenFolderAction, OpenFileFolderAction, AddRootFolderAction, RemoveRootFolderAction } from 'vs/workbench/browser/actions/fileActions'; | ||
| import { copyFocusedFilesExplorerViewItem, revealInOSFocusedFilesExplorerItem, openFocusedExplorerItemSideBySideCommand, copyPathOfFocusedExplorerItem, copyPathCommand, revealInExplorerCommand, revealInOSCommand, openFolderPickerCommand, openWindowCommand, openFileInNewWindowCommand, deleteFocusedFilesExplorerViewItemCommand, moveFocusedFilesExplorerViewItemToTrashCommand, renameFocusedFilesExplorerViewItemCommand } from 'vs/workbench/parts/files/browser/fileCommands'; | ||
| import { ExplorerViewerActionContributor as TerminalExplorerViewerActionContributor } from 'vs/workbench/parts/execution/browser/terminal.contribution'; |
There was a problem hiding this comment.
Compile error
| const actionBarRegistry = Registry.as<IActionBarRegistry>(ActionBarExtensions.Actionbar); | ||
| actionBarRegistry.registerActionBarContributor(Scope.VIEWER, FilesViewerActionContributor); | ||
| actionBarRegistry.registerActionBarContributor(Scope.VIEWER, ExplorerViewersActionContributor); | ||
| actionBarRegistry.registerActionBarContributor(Scope.VIEWER, TerminalExplorerViewerActionContributor); |
There was a problem hiding this comment.
This should move into execution-contribution.ts
| ], | ||
| 'description': nls.localize('sortOrder', "Controls the way of sorting files and directories in the explorer.") | ||
| } | ||
| }, |
There was a problem hiding this comment.
This should be contributed from execution.contribution.ts
| 'integrated' | ||
| ], | ||
| 'description': nls.localize('explorer.openInTerminalKind', "Customizes what kind of terminal to launch."), | ||
| 'default': 'external', |
There was a problem hiding this comment.
Make the default "integrated"?
| autoReveal: boolean; | ||
| enableDragAndDrop: boolean; | ||
| sortOrder: SortOrder; | ||
| openInTerminalKind: string; |
There was a problem hiding this comment.
This is not the right place to have it, it should be in execution contribution.
|
Peng Lyu (@rebornix) let's go with something like I created #30402 to do the eventual clean up I'd like to do. |
… point. Move them back to parts/execution. Dan may want to refactor it and merge with Terminal.
|
The final code change consists of
Look forward to seeing execution and terminal being merged and the |
Benjamin Pasero (bpasero)
left a comment
There was a problem hiding this comment.
Thanks, much better. Only noticed one nit: AbstarctOpenInTerminalAction (should be "abstract")
| export class OpenIntegratedTerminalAction extends AbstarctOpenInTerminalAction { | ||
|
|
||
| public static ID = 'workbench.action.terminal.openFolderInIntegratedTerminal'; | ||
| public static Label = nls.localize('openFolderInIntegratedTerminal', "Open in Integrated Terminal"); |
There was a problem hiding this comment.
I think we should be using the same name here - adding "Integrated" makes the context menu quite a bit wider without adding much.
There was a problem hiding this comment.
Revert to Open in Terminal now.
|
🎆 |



This is the first touch on Open Folder in Integrated Terminal. Some decisions still need to be revisited
terminal.terminalKindto align with https://github.com/Microsoft/vscode/blob/master/src/vs/workbench/parts/debug/common/debugProtocol.d.ts#L198 . We have put settings for integrated terminal inparts/terminalfolder and external ones inparts/execution. I'm not sure putting this one intoparts/explorerand name it asexplorer.terminalKindwould be a good idea as then we have settings for terminal in three different places.runInTerminalyet as it's up to the caller whether to use external or integrated terminal. ForopenInTerminal, we make the decision where we bind the action to the explorer. ForrunInTerminal, we make such decision when invoking terminals, e.g.,https://github.com/Microsoft/vscode/blob/master/src/vs/workbench/parts/debug/electron-browser/terminalSupport.ts#L21