laravel / ideas

Issues board used for Laravel internals discussions.
939 stars 28 forks source link

Add "editor" option to config/app.php via env #1257

Open robburley opened 6 years ago

robburley commented 6 years ago

Based off of a tweet from Marcel Pociot (https://twitter.com/marcelpociot/status/1016784890128470017), I'd like to add this option and pull the value from the .env file.

    /*
    |--------------------------------------------------------------------------
    | Editor
    |--------------------------------------------------------------------------
    |
    | This option specifies which editor the file will open with when
    | an error is handled by the Whoops error handler. If disabled
    | the link will be inactive and will not open in an editor.
    |
    | Supported: "sublime", "textmate", "emacs", "macvim", "phpstorm", "idea",
    |            "vscode", "atom"
    |
    */

    'editor' => env('APP_EDITOR', false),

and this to env.example

APP_EDITOR=

staudenmeir commented 6 years ago

I think it should be APP_EDITOR instead of EDITOR to match the other variables.

robburley commented 6 years ago

True, have updated the initial example.

staudenmeir commented 6 years ago

And there's a small typo: 'edit'

robburley commented 6 years ago

Thats embarrassing!

sisve commented 6 years ago

EDITOR is the system-wide editor which could be used as a fallback. Similar to how git checks for GIT_EDITOR and then EDITOR. (And then there's also VISUAL.)

BrandonSurowiec commented 6 years ago

Does this work? I tried it on my local Homestead box setup (Windows 7) and it didn't launch anything for Sublime Text when I clicked the link. Probably related to the fact that the files are in a virtual environment. Any other Windows users have this issue?

staudenmeir commented 6 years ago

Looks like you have to install this: https://github.com/ljubadr/sublime-protocol-win

BrandonSurowiec commented 6 years ago

@staudenmeir Thanks!