mirror of
https://github.com/Gu1llaum-3/sshm.git
synced 2026-01-27 03:04:21 +01:00
feat: add support for SSH RemoteCommand and RequestTTY in host configuration and TUI forms
- Allow users to specify a RemoteCommand to execute on SSH connection, both via TUI and config file - Add RequestTTY option (yes, no, force, auto) to host configuration and forms - Update config parsing and writing to handle new fields - Improve TUI forms to support editing and adding these options - Fix edit form standalone mode to allow proper quit/save via keyboard shortcuts
This commit is contained in:
12
cmd/root.go
12
cmd/root.go
@@ -140,11 +140,17 @@ func connectToHost(hostName string) {
|
||||
fmt.Printf("Connecting to %s...\n", hostName)
|
||||
|
||||
var sshCmd *exec.Cmd
|
||||
var args []string
|
||||
|
||||
if configFile != "" {
|
||||
sshCmd = exec.Command("ssh", "-F", configFile, hostName)
|
||||
} else {
|
||||
sshCmd = exec.Command("ssh", hostName)
|
||||
args = append(args, "-F", configFile)
|
||||
}
|
||||
args = append(args, hostName)
|
||||
|
||||
// Note: We don't add RemoteCommand here because if it's configured in SSH config,
|
||||
// SSH will handle it automatically. Adding it as a command line argument would conflict.
|
||||
|
||||
sshCmd = exec.Command("ssh", args...)
|
||||
|
||||
// Set up the command to use the same stdin, stdout, and stderr as the parent process
|
||||
sshCmd.Stdin = os.Stdin
|
||||
|
||||
Reference in New Issue
Block a user