Skip to content

installation prompts for modification of .bashrc which is wrong #2001

@godmar

Description

@godmar

Describe the bug

I'll let Copilot speak for itself:

❯ The instructions for a piece of software include this:
  Notice: /home/staff/gback/.local/bin is not in your PATH

  Would you like to add it to /home/staff/gback/.bashrc? [y/N] N

  Do you believe that .bashrc is the correct place for adding this?
  If not, where should it be added?

◐ The user's question doesn't seem to require a specific tool, so I think I can answer based on general 
  knowledge. For login shells, the PATH variable should typically be set in /.profile or /.bash_profile. 
  But, if you’re using an interactive non-login shell, .bashrc is the right place. It’s important to note 
  that for many distributions, .profile might source .bashrc, depending on the setup. If users follow 
  generic installer instructions, they might need to check their specific configurations.

● Usually no — ~/.bashrc is not the best default place for PATH.

  PATH is an environment setting, so it normally belongs in a login-shell startup file such as:

   - ~/.profile
   - or ~/.bash_profile / ~/.bash_login on Bash setups that use those

  Why: ~/.bashrc is mainly for interactive Bash-only settings like aliases and prompts. If you put PATH only
  there, login shells, scripts, GUI-launched apps, or other shells may not see it.

  Good rule:

   - Put export PATH="$HOME/.local/bin:$PATH" in ~/.profile
   - If needed, have ~/.bashrc only for interactive shell customizations

 ~/ [⎇ master]     

Affected version

GitHub Copilot CLI 1.0.4.

Steps to reproduce the behavior

  1. Try to install copilot
  2. See the wrong suggestion

Expected behavior

It should add it to ~/.profile or ~/.bash_profile.
Adding it to ~/.bashrc will result in repeated entries.

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions