Skip to content

fix: Cannot open file in Sublime Text #964

@FichteFoll

Description

@FichteFoll

🐛 The bug

I selected Sublime Text as my editor in the Nuxt devtools setting, but the file is not opened. Reading the exception on the console, this makes sense because apparently it tries to launch an executable named sublime, which does not exist. The expected executable name on Linux platform is subl, which is also configured as such in launch-editor.

The error:

The editor process exited with an error: spawn sublime ENOENT ('sublime' command does not exist in 'PATH').

Now, I do not know if this is an issue in launch-editor, but seeing how manually overriding the LAUNCH_EDITOR environment variable neither in the command that calls npm, nor in the .env file makes any difference, I suspect that the Nuxt devtools might be using this library incorrectly. I tried subl and sublime_text as values.

The library is invoked here:

await import('launch-editor').then(r => (r.default || r)(path + suffix, editor))

🛠️ To reproduce

  1. Ensure Sublime Text is installed (or create a fake subl executable on a Linux system)
  2. Configure "Sublime Text" to be the editor in devtools.
  3. Try to open an file in your editor.

🌈 Expected behavior

The file is opened in my local Sublime Text editor.

ℹ️ Additional context

I am using Arch Linux and installed Sublime Text using the official repository. subl is available on my $PATH and works in the terminal.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions