fix: enable editing and management of hosts from included SSH config files

• Add SourceFile field to SSHHost struct to track config file origins
• Implement FindHostInAllConfigs() to locate hosts across all config files
• Fix "host not found" errors when editing/deleting hosts from included files
• Add GetAllConfigFiles() and GetAllConfigFilesFromBase() for config discovery
• Create UpdateSSHHostV2() and DeleteSSHHostV2() for cross-file operations
• Display config file source in edit and info forms for better visibility
• Add intelligent file selector for host addition when multiple configs exist
• Support -c parameter context with proper file resolution
• Exclude .backup files from Include directive processing
• Maintain backward compatibility with existing SSH config workflows

Resolves limitation where hosts from included config files could be viewed
but not edited, deleted, or properly managed through the interface.
This commit is contained in:
2025-09-05 17:04:11 +02:00
parent b67f5abbbc
commit be3dcaa1cd
9 changed files with 751 additions and 41 deletions

View File

@@ -38,6 +38,7 @@ const (
ViewInfo
ViewPortForward
ViewHelp
ViewFileSelector
)
// PortForwardType defines the type of port forwarding
@@ -76,12 +77,13 @@ type Model struct {
configFile string // Path to the SSH config file
// View management
viewMode ViewMode
addForm *addFormModel
editForm *editFormModel
infoForm *infoFormModel
portForwardForm *portForwardModel
helpForm *helpModel
viewMode ViewMode
addForm *addFormModel
editForm *editFormModel
infoForm *infoFormModel
portForwardForm *portForwardModel
helpForm *helpModel
fileSelectorForm *fileSelectorModel
// Terminal size and styles
width int