Skip to content

Sublime Text exhibiting strange behavior when launched from Nushell 0.60.0 using PATH modifications #4967

Closed

Description

@ryanpcmcquen

Describe the bug

This is a strange bug. In Nushell 0.44.0, I had the following config:

path = [
    "/Applications/Sublime Text.app/Contents/SharedSupport/bin",
    "/Applications/Sublime Merge.app/Contents/SharedSupport/bin",
...

This allows launching subl and smerge from the command line without symlinking them somewhere else. Now it still works in Nushell 0.60.0, but somehow Sublime isn't recognizing any of its installed Packages. As if its being launched in a weird context where it can't pick them up. The effect of this is that any plugins (Prettier, LSP, et cetera) fail to function. If I launch Sublime Text using the absolute path in 0.60.0, everything works fine ('/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl').

Here's the relevant part of my 0.60.0 config:

let-env PATH = ($env.PATH | prepend [
    "/Applications/Sublime Text.app/Contents/SharedSupport/bin",
    "/Applications/Sublime Merge.app/Contents/SharedSupport/bin",
...

How to reproduce

  1. Set a path for Sublime Text's bin folder and launch it in a new terminal.
  2. Observe the lack of local packages running.

Expected behavior

Launch Sublime Text with local packages recognized as they are with the absolute path.

Screenshots

No response

Configuration

λ version | transpose key value | to md --pretty

key value
version 0.60.0
build_os macos-x86_64
rust_version rustc 1.59.0
cargo_version cargo 1.59.0
pkg_version 0.60.0
build_time 2022-03-22 19:07:11 +00:00
build_rust_channel release
features dataframe, default, trash, which, zip
installed_plugins

Additional context

No response

Activity

  1. changed the title [-]Sublime Text exhibiting strange behavior when launched from Nushell 0.60 using PATH modifications[/-] [+]Sublime Text exhibiting strange behavior when launched from Nushell 0.60.0 using PATH modifications[/+] on Mar 25, 2022
  2. sophiajt commented on Mar 25, 2022

    @sophiajt
    Contributor

    @ryanpcmcquen you need to prepend one at a time otherwise you're prepending a list of strings

  3. ryanpcmcquen commented on Mar 25, 2022

    @ryanpcmcquen
    Author

    @ryanpcmcquen you need to prepend one at a time otherwise you're prepending a list of strings

    @jntrnr, thank you! Is there any way to add multiple entries to the path?

  4. ryanpcmcquen commented on Mar 25, 2022

    @ryanpcmcquen
    Author

    Is this valid?

    let-env PATH = (
        $env.PATH |
        prepend "/Applications/Sublime Text.app/Contents/SharedSupport/bin" |
        prepend "/Applications/Sublime Merge.app/Contents/SharedSupport/bin" |
    
  5. ryanpcmcquen commented on Mar 25, 2022

    @ryanpcmcquen
    Author

    The behavior is the same with this syntax:

    let-env PATH = (
        $env.PATH |
        prepend "/Applications/Sublime Text.app/Contents/SharedSupport/bin"
    )
    let-env PATH = (
        $env.PATH |
        prepend "/Applications/Sublime Merge.app/Contents/SharedSupport/bin"
    )
    

    Meaning Sublime Text still isn't picking up its plugins.

  6. sophiajt commented on Mar 25, 2022

    @sophiajt
    Contributor

    Not sure what might be going on. You may want to just double check that the path looks right before you invoke Sublime. Something like:

    > ^env
    

    And then read through PATH in that to see if it looks right

  7. ryanpcmcquen commented on Mar 26, 2022

    @ryanpcmcquen
    Author

    Looks correct @jntrnr:

    λ ^env | grep ^PATH
    PATH=/Library/Apple/usr/bin:/Applications/Sublime Merge.app/Contents/SharedSupport/bin:/Applications/Sublime Text.app/Contents/SharedSupport/bin:
    
    λ $env.PATH
    ╭────┬────────────────────────────────────────────────────────────╮
    │  0 │ /Library/Apple/usr/bin                                     │
    │  1 │ /Applications/Sublime Merge.app/Contents/SharedSupport/bin │
    │  2 │ /Applications/Sublime Text.app/Contents/SharedSupport/bin  │
    
  8. ryanpcmcquen commented on Mar 28, 2022

    @ryanpcmcquen
    Author

    I still haven't found a workaround here, I've tried a manual shell script at /usr/local/bin/subl that launches the full path of subl, but nothing is working to pick up the right context/environment for Sublime. I've temporarily switched to zsh where modifying the PATH there creates no such issue, but I'm already missing nushell!

  9. ryanpcmcquen commented on Apr 13, 2022

    @ryanpcmcquen
    Author

    Just confirming that this is still an issue on 0.61.0.

  10. hustcer commented on May 30, 2022

    @hustcer
    Contributor

    @ryanpcmcquen Please update to the latest version v0.63 and add the following lines to your config.nu

    let-env PATH = (
      $env.PATH
        | prepend `/Applications/Sublime Text.app/Contents/SharedSupport/bin/`
        | prepend `/Applications/Sublime Merge.app/Contents/SharedSupport/bin/`
    )
    

    It works for me

  11. hustcer commented on Jun 6, 2022

    @hustcer
    Contributor

    Since there is no further response, I will close it, feel free to reopen if you still have such issue

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions