Skip to content

Fix #8132. Open folder in integrated terminal. - #30354

Merged
Daniel Imms (Tyriar) merged 6 commits into
microsoft:masterfrom
rebornix:OpenInIntegratedTerminal
Jul 12, 2017
Merged

Daniel Imms (Tyriar) merged 6 commits into
microsoft:masterfrom
rebornix:OpenInIntegratedTerminal

Conversation

@rebornix

@rebornix Peng Lyu (rebornix) commented Jul 10, 2017 •

Copy link
Copy Markdown
Contributor

This is the first touch on Open Folder in Integrated Terminal. Some decisions still need to be revisited

@rebornix
Peng Lyu (rebornix) force-pushed the OpenInIntegratedTerminal branch from c2fa180 to 1234133 Compare July 10, 2017 21:34
}

this.terminalService.openTerminal(pathToOpen);
const configuration = this.configurationService.getConfiguration<ITerminalConfiguration>();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch, addressed.

@rebornix

Copy link
Copy Markdown
Contributor Author

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can be pulled into AbstarctOpenInTerminalAction?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed.

@Tyriar

Copy link
Copy Markdown
Contributor

Benjamin Pasero (@bpasero) please review the changes in fileActions and the new explorer.openInTerminalKind settings key. The original proposal introduced a terminal.terminalKind key which is awkward because it would represent a new settings category (or merging of external/integrated terminal categories):

image

Also because I really feel this belongs in the File Explorer category as the functionality is contained within that component:

image

@rebornix

Copy link
Copy Markdown
Contributor Author

The context menu with new action

screen shot 2017-07-10 at 4 58 15 pm

@bpasero Benjamin Pasero (bpasero) left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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';

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Compile error

const actionBarRegistry = Registry.as<IActionBarRegistry>(ActionBarExtensions.Actionbar);
actionBarRegistry.registerActionBarContributor(Scope.VIEWER, FilesViewerActionContributor);
actionBarRegistry.registerActionBarContributor(Scope.VIEWER, ExplorerViewersActionContributor);
actionBarRegistry.registerActionBarContributor(Scope.VIEWER, TerminalExplorerViewerActionContributor);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should move into execution-contribution.ts

],
'description': nls.localize('sortOrder', "Controls the way of sorting files and directories in the explorer.")
}
},

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be contributed from execution.contribution.ts

'integrated'
],
'description': nls.localize('explorer.openInTerminalKind', "Customizes what kind of terminal to launch."),
'default': 'external',

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make the default "integrated"?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

autoReveal: boolean;
enableDragAndDrop: boolean;
sortOrder: SortOrder;
openInTerminalKind: string;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not the right place to have it, it should be in execution contribution.

@Tyriar

Copy link
Copy Markdown
Contributor

Peng Lyu (@rebornix) let's go with something like terminal.explorerKind as a contribution within the Integrated Terminal settings category.

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.
@rebornix

Peng Lyu (rebornix) commented Jul 11, 2017 •

Copy link
Copy Markdown
Contributor Author

The final code change consists of

  • Option terminal.explorerKind
  • Register Open In Integrated Terminal action when above option is set to integrated (which is the default value)
  • Merge execution.contribution and terminal.contribution.
  • Update test cases to avoid failure.

Look forward to seeing execution and terminal being merged and the common code being the share part of execution and terminal.

@bpasero Benjamin Pasero (bpasero) left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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");

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should be using the same name here - adding "Integrated" makes the context menu quite a bit wider without adding much.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Revert to Open in Terminal now.

@Tyriar
Daniel Imms (Tyriar) merged commit 3eefd7f into microsoft:master Jul 12, 2017
@Tyriar

Copy link
Copy Markdown
Contributor

🎆

@Tyriar Daniel Imms (Tyriar) added this to the July 2017 milestone Jul 17, 2017
@github-actions github-actions Bot locked and limited conversation to collaborators Mar 27, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants