File tree Expand file tree Collapse file tree 1 file changed +6
-8
lines changed Expand file tree Collapse file tree 1 file changed +6
-8
lines changed Original file line number Diff line number Diff line change @@ -374,14 +374,12 @@ func detectOpenSSHInfo(sshExe SSHExe) openSSHInfo {
374374 exe sshExecutable
375375 stderr bytes.Buffer
376376 )
377- // TODO: Fix this function to properly handle complex SSH commands like "kitten ssh"
378- // The current LookPath, os.Stat, and caching logic doesn't work well for multi-word commands
379- path , err := exec .LookPath (sshExe .Exe )
380- if err != nil {
381- logrus .Warnf ("failed to find ssh executable: %v" , err )
382- } else {
383- st , _ := os .Stat (path )
384- exe = sshExecutable {Path : path , Size : st .Size (), ModTime : st .ModTime ()}
377+ // Note: For SSH wrappers like "kitten ssh", os.Stat will check the wrapper
378+ // executable (kitten) instead of the underlying ssh binary. This means
379+ // cache invalidation won't work properly - ssh upgrades won't be detected
380+ // since kitten's size/mtime won't change. This is probably acceptable.
381+ if st , err := os .Stat (sshExe .Exe ); err == nil {
382+ exe = sshExecutable {Path : sshExe .Exe , Size : st .Size (), ModTime : st .ModTime ()}
385383 openSSHInfosRW .RLock ()
386384 info := openSSHInfos [exe ]
387385 openSSHInfosRW .RUnlock ()
You can’t perform that action at this time.
0 commit comments