Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ make run
| ↑↓/jk | Navigate servers |
| Enter | SSH into selected server |
| c | Copy SSH command to clipboard |
| h | Copy Host to clipboard |
| g | Ping selected server |
| r | Refresh background data |
| a | Add server |
Expand Down
14 changes: 14 additions & 0 deletions internal/adapters/ui/handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@ func (t *tui) handleGlobalKeys(event *tcell.EventKey) *tcell.EventKey {
case 'c':
t.handleCopyCommand()
return nil
case 'h':
t.handleCopyHost()
return nil
case 'g':
t.handlePingSelected()
return nil
Expand Down Expand Up @@ -139,6 +142,17 @@ func (t *tui) handleCopyCommand() {
}
}

func (t *tui) handleCopyHost() {
if server, ok := t.serverList.GetSelectedServer(); ok {
host := server.Host
if err := clipboard.WriteAll(host); err == nil {
t.showStatusTemp("Copied: " + host)
} else {
t.showStatusTemp("Failed to copy to clipboard")
}
}
}

func (t *tui) handleTagsEdit() {
if server, ok := t.serverList.GetSelectedServer(); ok {
t.showEditTagsForm(server)
Expand Down
2 changes: 1 addition & 1 deletion internal/adapters/ui/server_details.go
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ func (sd *ServerDetails) UpdateServer(server domain.Server) {
}

// Commands list
text += "\n[::b]Commands:[-]\n Enter: SSH connect\n f: Port forward\n x: Stop forwarding\n c: Copy SSH command\n g: Ping server\n r: Refresh list\n a: Add new server\n e: Edit entry\n t: Edit tags\n d: Delete entry\n p: Pin/Unpin"
text += "\n[::b]Commands:[-]\n Enter: SSH connect\n f: Port forward\n x: Stop forwarding\n c: Copy SSH command\n h: Copy Host\n g: Ping server\n r: Refresh list\n a: Add new server\n e: Edit entry\n t: Edit tags\n d: Delete entry\n p: Pin/Unpin"

sd.TextView.SetText(text)
}
Expand Down
2 changes: 1 addition & 1 deletion internal/adapters/ui/status_bar.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (
)

func DefaultStatusText() string {
return "[white]↑↓[-] Navigate • [white]Enter[-] SSH • [white]f[-] Forward • [white]x[-] Stop Forward • [white]c[-] Copy SSH • [white]a[-] Add • [white]e[-] Edit • [white]g[-] Ping • [white]d[-] Delete • [white]p[-] Pin/Unpin • [white]/[-] Search • [white]q[-] Quit"
return "[white]↑↓[-] Navigate • [white]Enter[-] SSH • [white]f[-] Forward • [white]x[-] Stop Forward • [white]c[-] Copy SSH • [white]h[-] Copy Host • [white]a[-] Add • [white]e[-] Edit • [white]g[-] Ping • [white]d[-] Delete • [white]p[-] Pin/Unpin • [white]/[-] Search • [white]q[-] Quit"
}

func NewStatusBar() *tview.TextView {
Expand Down