File tree Expand file tree Collapse file tree 4 files changed +22
-0
lines changed Expand file tree Collapse file tree 4 files changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p
99### Added
1010
1111- Adds pinning of comparisons in the _ Compare_ view &mdash ; pinned comparisons will persist across reloads
12+ - Adds an _ Open in Terminal_ command to repositories in the _ Repositories_ view
1213
1314### Fixed
1415
Original file line number Diff line number Diff line change 22472247 "light" : " images/light/icon-push-force.svg"
22482248 }
22492249 },
2250+ {
2251+ "command" : " gitlens.views.openInTerminal" ,
2252+ "title" : " Open in Terminal" ,
2253+ "category" : " GitLens"
2254+ },
22502255 {
22512256 "command" : " gitlens.views.setAsDefault" ,
22522257 "title" : " Set as Default" ,
30833088 "command" : " gitlens.views.pushWithForce" ,
30843089 "when" : " false"
30853090 },
3091+ {
3092+ "command" : " gitlens.views.openInTerminal" ,
3093+ "when" : " false"
3094+ },
30863095 {
30873096 "command" : " gitlens.views.setAsDefault" ,
30883097 "when" : " false"
43324341 "group" : " 1_gitlens@2"
43334342 },
43344343 {
4344+ "command" : " gitlens.views.openInTerminal" ,
4345+ "when" : " viewItem =~ /gitlens:repository\\ b/" ,
4346+ "group" : " 2_gitlens@1"
4347+ },
43354348 {
43364349 "command" : " gitlens.openRepoInRemote" ,
43374350 "when" : " viewItem =~ /gitlens:repository\\ b/ && gitlens:hasRemotes" ,
Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ export enum BuiltInCommands {
1818 FocusFilesExplorer = 'workbench.files.action.focusFilesExplorer' ,
1919 Open = 'vscode.open' ,
2020 OpenFolder = 'vscode.openFolder' ,
21+ OpenInTerminal = 'openInTerminal' ,
2122 NextEditor = 'workbench.action.nextEditor' ,
2223 PreviewHtml = 'vscode.previewHtml' ,
2324 RevealLine = 'revealLine' ,
Original file line number Diff line number Diff line change @@ -77,6 +77,7 @@ export class ViewCommands implements Disposable {
7777 commands . registerCommand ( 'gitlens.views.setAsDefault' , this . setAsDefault , this ) ;
7878 commands . registerCommand ( 'gitlens.views.unsetAsDefault' , this . unsetAsDefault , this ) ;
7979
80+ commands . registerCommand ( 'gitlens.views.openInTerminal' , this . openInTerminal , this ) ;
8081 commands . registerCommand ( 'gitlens.views.star' , this . star , this ) ;
8182 commands . registerCommand ( 'gitlens.views.unstar' , this . unstar , this ) ;
8283
@@ -457,6 +458,12 @@ export class ViewCommands implements Disposable {
457458 } as OpenFileInRemoteCommandArgs ) ;
458459 }
459460
461+ private openInTerminal ( node : RepositoryNode ) {
462+ if ( ! ( node instanceof RepositoryNode ) ) return ;
463+
464+ return commands . executeCommand ( BuiltInCommands . OpenInTerminal , Uri . file ( node . repo . path ) ) ;
465+ }
466+
460467 private setAsDefault ( node : RemoteNode ) {
461468 if ( node instanceof RemoteNode ) return node . setAsDefault ( ) ;
462469 return ;
You can’t perform that action at this time.
0 commit comments