diff options
author | Marc Cornellà <marc.cornella@live.com> | 2019-09-19 16:20:02 +0200 |
---|---|---|
committer | Marc Cornellà <marc.cornella@live.com> | 2019-09-19 16:20:02 +0200 |
commit | 095d56b5ea44988c83d0be501e70f37df3d5066b (patch) | |
tree | 7cd1d829905e77d1a9af9624865a4b212bc49710 /plugins/sublime | |
parent | 32338fd40cae45c775dadc34ae05476811a3834b (diff) | |
download | zsh-095d56b5ea44988c83d0be501e70f37df3d5066b.tar.gz zsh-095d56b5ea44988c83d0be501e70f37df3d5066b.tar.bz2 zsh-095d56b5ea44988c83d0be501e70f37df3d5066b.zip |
Fix WSL check for WSL 2 and simplify nohup in open_command
WSL 2 changes the output of `uname -r`. For instance,
WSL 1: 4.4.0-18980-Microsoft
WSL 2: 4.19.67-microsoft-standard
Since WSL 2 lowercases the M, we can match for the rest of the string
which remains lowercase throughout both versions. Another option would
be to match for both upper- and lower-case Ms, like that:
$(uname -r) = *[Mm]icrosoft*
Fixed use of nohup in open_command where it was only necessary for
xdg-open (and actually harmful for cmd.exe in WSL 2). The current logic
is simpler and more future-proof.
Diffstat (limited to 'plugins/sublime')
-rw-r--r-- | plugins/sublime/sublime.plugin.zsh | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/plugins/sublime/sublime.plugin.zsh b/plugins/sublime/sublime.plugin.zsh index 3a82d6c7f..69604ab4f 100644 --- a/plugins/sublime/sublime.plugin.zsh +++ b/plugins/sublime/sublime.plugin.zsh @@ -15,7 +15,7 @@ alias stn=create_project declare -a _sublime_paths if [[ "$OSTYPE" == linux* ]]; then - if [[ "$(uname -r)" = *Microsoft* ]]; then + if [[ "$(uname -r)" = *icrosoft* ]]; then _sublime_paths=( "$(wslpath -u 'C:\Program Files\Sublime Text 3\subl.exe')" "$(wslpath -u 'C:\Program Files\Sublime Text 2\subl.exe')" |