Skip to content

terminal path ordering not consistent on mac #10997

Open

Description

@dpastoor

System details

RStudio Edition : Desktop
RStudio Version : "Spotted Wakerobin" Daily (1b34f229, 2022-04-15) for macOS
OS Version      : Mac
R Version       : 4.1

Steps to reproduce the problem

Open Rstudio via finder or other non-terminal launcher. Open a terminal and check paths

Describe the problem in detail

There is a discrepancy in the path ordering in the RStudio terminal compared to using the terminal normally. Of particular interest is making sure there is consistency in /homebrew/bin

In rstudio terminal we see:

image

regular terminal for default shell (fish) and in bash to be consistent with what rstudio launches

image

confirming bash is default shell in rstudio terminal

devins-mbp-2:quartoprojembed devin$ ps -p $$
  PID TTY           TIME CMD
24694 ttys007    0:00.01 bash -l

Describe the behavior you expected

expected consistency between path implementations, if possible.

  • I have read the guide for submitting good bug reports.
  • I have installed the latest version of RStudio, and confirmed that the issue still persists.
  • [] If I am reporting an RStudio crash, I have included a diagnostics report.
  • I have done my best to include a minimal, self-contained set of instructions for consistently reproducing the issue.

Activity

  1. kevinushey commented on Apr 15, 2022

    @kevinushey
    Collaborator

    What is the output of PATH= $SHELL -l -c 'printf "%s" "$PATH"', in your shell?

  2. kevinushey commented on Apr 15, 2022

    @kevinushey
    Collaborator

    Also, do you see any relevant diagnostic entries in ~/.local/share/rstudio/log?

  3. dpastoor commented on Apr 25, 2022

    @dpastoor
    Author

    sorry for the delay:

    devins-mbp-2:environments.rstudio.com devin$ PATH= $SHELL -l -c 'printf "%s" "$PATH"'
    /opt/homebrew/bin:/opt/homebrew/sbin:/Users/devin/go/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:.devins-mbp-2:environments.rstudio.com 
    devin$ echo $PATH
    /usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/Users/devin/Applications/quarto/bin:/Applications/RStudio.app/Contents/MacOS
    
    devins-mbp-2:environments.rstudio.com devin$ cat ~/.config/fish/config.fish 
    source ~/.config/fish/env.fish
    if status is-interactive
        # Commands to run in interactive sessions can go here
    end
    eval (/opt/homebrew/bin/brew shellenv)
    starship init fish | source
    
    fish_add_path ~/go/bin
    

    In checking in ~/.local/share/rstudio/log I didn't see anything relevant.

  4. dpastoor commented on Apr 25, 2022

    @dpastoor
    Author

    ah - I had downgraded to the preview release to revert some daily bugs, I need to rerun the above with the daily again, hold tight

  5. dpastoor commented on Apr 25, 2022

    @dpastoor
    Author

    kk

    RStudio 2022.06.0-daily+324 "Spotted Wakerobin" Daily (64ee43493bae9754916b9f18f91fe79a6ba9b8a9, 2022-04-25) for macOS
    Mozilla/5.0 (Macintosh; Intel Mac OS X 12_1_0) AppleWebKit/537.36 (KHTML, like Gecko) QtWebEngine/5.12.10 Chrome/69.0.3497.128 Safari/537.36
    
    devins-mbp-2:environments.rstudio.com devin$ PATH= $SHELL -l -c 'printf "%s" "$PATH"'
    /opt/homebrew/bin:/opt/homebrew/sbin:/Users/devin/go/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:.
    devins-mbp-2:environments.rstudio.com devin$ echo $PATH
    /usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/Users/devin/go/bin:/Users/devin/Applications/quarto/bin:/Library/TeX/texbin:/usr/texbin:/Applications/RStudio.app/Contents/MacOS
    
  6. 9 remaining items

  7. jthomasmock commented on May 27, 2022

    @jthomasmock
    Contributor

    Per @kevinushey - adding some notes here.

    On Mac:

    [1] "macOS Monterey 12.2.1"
    R version 4.2.0 (2022-04-22)
    platform       aarch64-apple-darwin20   
    $mode
    [1] "desktop"
    $version
    [1] '2022.6.0.421'
    $long_version
    [1] "2022.06.0-daily+421"
    $release_name
    [1] "Spotted Wakerobin"
    

    I have the following command at the bottom of my .profile in the home directory.

    export PATH="/Users/thomasmock/quarto-cli/package/dist/bin/:$PATH"
    

    This adds a dev version of quarto to my $PATH and is then accessible by a terminal, integrated into RStudio or elsewhere.

    However, RStudio is not "picking up" the $PATH addition as it is using an older version of Quarto with RStudio > Render, and the following commands point at a different executable. Calling system("echo $PATH") also returns a $PATH missing the export from above.

    Sys.which("quarto")
    #> quarto 
    #> "/usr/local/bin/quarto" 
    system("which quarto")
    #> /usr/local/bin/quarto
    
    PATH= $SHELL -l -c 'printf "%s" "$PATH"'
    # outputs below
    /Users/thomasmock/.pyenv/shims:/Users/thomasmock/.pyenv/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/binThomass-MacBook-Pro:etc thomasmock$ 
    
    system("PATH= $SHELL -l -c 'printf \"%s\" \"$PATH\"'")
    # outputs
    /Users/thomasmock/.pyenv/shims:/Users/thomasmock/.pyenv/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin
    
  8. kevinushey commented on May 27, 2022

    @kevinushey
    Collaborator

    @jthomasmock, can you also share the output of:

    PATH= $SHELL -l -c 'printf "%s" "$PATH"'
    

    as executed from a shell? The output of:

    system("PATH= $SHELL -l -c 'printf \"%s\" \"$PATH\"'")
    

    from the RStudio R console might also be useful.

  9. jthomasmock commented on May 27, 2022

    @jthomasmock
    Contributor

    @jthomasmock, can you also share the output of:

    PATH= $SHELL -l -c 'printf "%s" "$PATH"'
    

    as executed from a shell? The output of:

    system("PATH= $SHELL -l -c 'printf \"%s\" \"$PATH\"'")
    

    from the RStudio R console might also be useful.

    Added to comment above so it's all in one place - thanks!

  10. removed their assignment
    on Jul 7, 2022
  11. mikebessuille commented on Mar 3, 2023

    @mikebessuille
    Contributor

    Maybe related to #11822 ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions