fork/gdu
git clone https://git.julia.blue/fork/gdu
34f3996
master
1package tui 2 3import ( 4"os" 5) 6 7func getShellBin ()string { 8shellbin ,ok := os .LookupEnv ("COMSPEC" ) 9if ! ok { 10shellbin = "C:\\WINDOWS\\System32\\cmd.exe" 11 } 12return shellbin 13} 14 15func (ui * UI )spawnShell () { 16if ui .currentDir == nil { 17return 18 } 19if ui .atVirtualRoot () { 20ui .showMessage ("Shell cannot be spawned at the virtual top level directory" ) 21return 22 } 23 24ui .app .Stop () 25 26if err := os .Chdir (ui .currentDirPath );err != nil { 27ui .showErr ("Error changing directory" ,err ) 28return 29 } 30if err := ui .exec (getShellBin (),nil ,os .Environ ());err != nil { 31ui .showErr ("Error executing shell" ,err ) 32 } 33} 34 35func stopProcess ()error { 36return nil 37}