Skip to content

Prompt for machine name at chezmoi init#5

Draft
hdp617 wants to merge 1 commit into
mainfrom
cursor/prompt-machine-name-bb31
Draft

Prompt for machine name at chezmoi init#5
hdp617 wants to merge 1 commit into
mainfrom
cursor/prompt-machine-name-bb31

Conversation

@hdp617

@hdp617 hdp617 commented Jul 9, 2026

Copy link
Copy Markdown
Owner

Summary

~/.name was templated to darwin or linux, which is not useful for tmux status or shell prompts. This prompts for a human-readable machine name at chezmoi init, defaulting to the system hostname.

Changes

  • Add machine_name to chezmoi [data] via promptStringOnce (default: .chezmoi.hostname).
  • Template dot_name.tmpl from machine_name instead of .chezmoi.os.

Test plan

  • chezmoi init on a fresh machine (or chezmoi data set machine_name=... + chezmoi apply)
  • Confirm ~/.name contains the chosen name
  • Confirm tmux status bar and prompts display it
Open in Web Open in Cursor 

Replace ~/.name content of darwin/linux with promptStringOnce machine_name,
defaulting to .chezmoi.hostname. Used by tmux status bar and shell prompts.

Co-authored-by: Huy Pham <hdp617@users.noreply.github.com>

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a new machine_name configuration option to the Chezmoi setup. It prompts the user for a machine name (defaulting to the hostname) in .chezmoi.toml.tmpl and updates dot_name.tmpl to use this value, falling back to the hostname if not defined. I have no feedback to provide as there are no review comments.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

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