@@ -13,6 +13,7 @@ import {
1313 globalStore ,
1414 WOS ,
1515} from "@/app/store/global" ;
16+ import { ConnectionsModel } from "@/app/store/connections-model" ;
1617import { globalRefocusWithTimeout } from "@/app/store/keymodel" ;
1718import { RpcApi } from "@/app/store/wshclientapi" ;
1819import { TabRpcClient } from "@/app/store/wshrpcutil" ;
@@ -172,12 +173,26 @@ function getLocalSuggestions(
172173 connSelected : string ,
173174 connStatusMap : Map < string , ConnStatus > ,
174175 fullConfig : FullConfigType ,
175- filterOutNowsh : boolean
176+ filterOutNowsh : boolean ,
177+ hasGitBash : boolean
176178) : SuggestionConnectionScope | null {
177179 const wslFiltered = filterConnections ( connList , connSelected , fullConfig , filterOutNowsh ) ;
178180 const wslSuggestionItems = createWslSuggestionItems ( wslFiltered , connection , connStatusMap ) ;
179181 const localSuggestionItem = createFilteredLocalSuggestionItem ( localName , connection , connSelected ) ;
180- const combinedSuggestionItems = [ ...localSuggestionItem , ...wslSuggestionItems ] ;
182+
183+ const gitBashItems : Array < SuggestionConnectionItem > = [ ] ;
184+ if ( hasGitBash && "Git Bash" . toLowerCase ( ) . includes ( connSelected . toLowerCase ( ) ) ) {
185+ gitBashItems . push ( {
186+ status : "connected" ,
187+ icon : "laptop" ,
188+ iconColor : "var(--grey-text-color)" ,
189+ value : "local:gitbash" ,
190+ label : "Git Bash" ,
191+ current : connection === "local:gitbash" ,
192+ } ) ;
193+ }
194+
195+ const combinedSuggestionItems = [ ...localSuggestionItem , ...gitBashItems , ...wslSuggestionItems ] ;
181196 const sortedSuggestionItems = sortConnSuggestionItems ( combinedSuggestionItems , fullConfig ) ;
182197 if ( sortedSuggestionItems . length == 0 ) {
183198 return null ;
@@ -346,6 +361,7 @@ const ChangeConnectionBlockModal = React.memo(
346361 const fullConfig = jotai . useAtomValue ( atoms . fullConfigAtom ) ;
347362 let filterOutNowsh = util . useAtomValueSafe ( viewModel . filterOutNowsh ) ?? true ;
348363 const showS3 = util . useAtomValueSafe ( viewModel . showS3 ) ?? false ;
364+ const hasGitBash = jotai . useAtomValue ( ConnectionsModel . getInstance ( ) . hasGitBashAtom ) ;
349365
350366 let maxActiveConnNum = 1 ;
351367 for ( const conn of allConnStatus ) {
@@ -425,7 +441,8 @@ const ChangeConnectionBlockModal = React.memo(
425441 connSelected ,
426442 connStatusMap ,
427443 fullConfig ,
428- filterOutNowsh
444+ filterOutNowsh ,
445+ hasGitBash
429446 ) ;
430447 const remoteSuggestions = getRemoteSuggestions (
431448 connList ,
0 commit comments