Skip to content

fix(osx): use console owner instead of $USER in postinstall script#2279

Open
Copilot wants to merge 3 commits intomainfrom
copilot/create-answer-for-issue-1982
Open

fix(osx): use console owner instead of $USER in postinstall script#2279
Copilot wants to merge 3 commits intomainfrom
copilot/create-answer-for-issue-1982

Conversation

Copy link

Copilot AI commented Mar 4, 2026

  • Fix postinstall script: replace ${USER} with stat -f%Su /dev/console
  • Address review comment: handle SSH/headless installs where no console user exists
    • Try SUDO_USER first (set by sudo, reliable in both GUI/Homebrew and SSH contexts)
    • Fall back to stat -f%Su /dev/console for GUI sessions without sudo
    • If real user can't be determined (result is root or empty), skip configure and print a warning with manual instructions

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

…nstall script

Co-authored-by: marekzmyslowski <1062877+marekzmyslowski@users.noreply.github.com>
Copilot AI changed the title [WIP] Add response to user in issue 1982 fix(osx): use console owner instead of $USER in postinstall script Mar 4, 2026
@marekzmyslowski marekzmyslowski marked this pull request as ready for review March 12, 2026 08:03
@marekzmyslowski marekzmyslowski requested a review from a team as a code owner March 12, 2026 08:03
# from taking ownership of ~/.gitconfig).
# Use stat to determine the console user since the installer may be invoked with
# USER unset (e.g. when run via Homebrew which explicitly clears USER).
REAL_USER=$(stat -f%Su /dev/console)
Copy link
Contributor

Choose a reason for hiding this comment

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

What happens if someone is installing GCM (either via Homebrew or the installer command line) from an SSH session where there is no console user? We need to make sure this works for remote/multi-user scenarios.

…fallback

Co-authored-by: marekzmyslowski <1062877+marekzmyslowski@users.noreply.github.com>
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.

3 participants