Skip to content

Add #951: copy-host-address button to per-host statusbar#952

Merged
binaricat merged 1 commit into
mainfrom
fix/951-copy-ip-button
May 11, 2026
Merged

Add #951: copy-host-address button to per-host statusbar#952
binaricat merged 1 commit into
mainfrom
fix/951-copy-ip-button

Conversation

@binaricat
Copy link
Copy Markdown
Owner

Summary

Closes #951. Adds a small clipboard-copy icon to the terminal pane's statusbar (the row with the host label, status dot, and CPU/MEM/disk stats). Clicking it copies the host's hostname / IP and shows a toast.

The button only renders for non-local sessions (SSH/serial/telnet with a real address). Local shells don't have an addressable hostname so showing it would be confusing.

Why statusbar, not top tab

The top tab can be shared across multiple panes in a workspace (mixed hosts), so a button there would be ambiguous about "which host's IP". The per-host statusbar carries exactly one host, so the action is unambiguous.

Visual

Matches the surrounding pattern: 10px icon, inline with the existing host label + status dot, opacity-60 → opacity-100 on hover, title attribute for the tooltip (consistent with the CPU/MEM/disk stat triggers right next to it).

Test plan

  • npm test — 788 pass / 0 fail
  • npm run lint — clean
  • npm run build — clean
  • Manual: click the button on a remote SSH session → host's IP/hostname copied to clipboard, success toast surfaces
  • Manual: confirm button is hidden on local terminal sessions
  • Manual: zh-CN locale shows the localized tooltip + toast text

Closes #951.

)

Adds a small clipboard-copy icon next to the host label / status dot in
the terminal pane's statusbar. Clicking copies the host's hostname
(IP or DNS name — what users called "machine IP" in #951) to the
clipboard and surfaces a toast.

The button only renders for non-local SSH/serial/telnet sessions —
local shells don't have an addressable hostname so showing it would
be confusing.

Placed in the pane statusbar (not the top tab) because the statusbar
is per-host: a workspace pane carries exactly one host, so the button
always identifies the right address. Top tabs in a workspace can share
multiple panes / hosts and would be ambiguous.

Visual treatment matches the surrounding stats buttons: 10px icon,
inline with the existing host label + status dot, opacity-60 →
opacity-100 on hover, `title` attribute for the tooltip to match the
pattern of the CPU/MEM/disk stats triggers right next to it.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@binaricat binaricat merged commit 109d0a7 into main May 11, 2026
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

终端窗口能不能添加一个快速复制当前机器 ip 的按钮

1 participant