Skip to content

chore: show user/host in tmux status bar#349

Merged
himkt merged 2 commits intomainfrom
tmux-status
Apr 10, 2026
Merged

chore: show user/host in tmux status bar#349
himkt merged 2 commits intomainfrom
tmux-status

Conversation

@himkt
Copy link
Copy Markdown
Owner

@himkt himkt commented Apr 10, 2026

No description provided.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the tmux status bar configuration to display the current user and host on the right side of the status line.

Changes:

  • Replace the existing status-right time display with user@host rendering.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

status_left2="#S #{?client_prefix,#[fg=colour31]#[bg=colour234]#[nobold],#[fg=colour254]#[bg=colour234]#[nobold]}"
set -qg status-left $status_left1' '$status_left2
set -qg status-right '%H:%M #[fg=colour16,bg=colour254]'
set -qg status-right ' #[fg=colour244]#(whoami)@#h #[fg=colour16,bg=colour254]'
Copy link

Copilot AI Apr 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#(whoami) runs an external shell command and will be executed on every status redraw (status-interval is 2s in this file), which adds unnecessary process spawn overhead. Prefer a built-in tmux format (if available) or a value computed once (e.g., via an environment/user option) to avoid running whoami repeatedly.

Suggested change
set -qg status-right ' #[fg=colour244]#(whoami)@#h #[fg=colour16,bg=colour254]'
set -g @status_user "$USER"
set -qg status-right ' #[fg=colour244]#{@status_user}@#h #[fg=colour16,bg=colour254]'

Copilot uses AI. Check for mistakes.
status_left2="#S #{?client_prefix,#[fg=colour31]#[bg=colour234]#[nobold],#[fg=colour254]#[bg=colour234]#[nobold]}"
set -qg status-left $status_left1' '$status_left2
set -qg status-right '%H:%M #[fg=colour16,bg=colour254]'
set -qg status-right ' #[fg=colour244]#(whoami)@#h #[fg=colour16,bg=colour254]'
Copy link

Copilot AI Apr 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change removes the existing time display (%H:%M) from status-right, but the PR title only mentions showing user/host. If the time is still desired, consider including it alongside user@host, or update the PR description/title to reflect the behavioral change.

Copilot uses AI. Check for mistakes.
status_left2="#S #{?client_prefix,#[fg=colour31]#[bg=colour234]#[nobold],#[fg=colour254]#[bg=colour234]#[nobold]}"
set -qg status-left $status_left1' '$status_left2
set -qg status-right '%H:%M #[fg=colour16,bg=colour254]'
set -qg status-right ' #[fg=colour244]#(whoami)@#h #[fg=colour16,bg=colour254]'
Copy link

Copilot AI Apr 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The trailing style segment #[fg=colour16,bg=colour254] has no text following it, so it likely has no visible effect and makes the format harder to understand. Consider removing it or appending the intended content (e.g., if it was meant to style a time segment).

Suggested change
set -qg status-right ' #[fg=colour244]#(whoami)@#h #[fg=colour16,bg=colour254]'
set -qg status-right ' #[fg=colour244]#(whoami)@#h'

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +49 to +50
set -g @status_user "$USER"
set -qg status-right ' #[fg=colour244]#{@status_user}@#h'
Copy link

Copilot AI Apr 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change replaces the previous clock (%H:%M) in status-right with user@host, which removes the time display entirely. If the intent is to add user/host rather than replace the existing clock, consider appending/prepending user@host while keeping %H:%M so the status bar doesn’t regress in functionality.

Copilot uses AI. Check for mistakes.
@himkt himkt merged commit 55d701e into main Apr 10, 2026
7 checks passed
@himkt himkt deleted the tmux-status branch April 10, 2026 13:24
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.

2 participants