Spaceship-prompt: Better Windows / MSYS2 support

Created on 30 Jun 2018  路  2Comments  路  Source: denysdovhan/spaceship-prompt

Current behavior

There were so many headaches getting this working on Windows. Probably mostly with MSYS2 which doesn't seem to like symlinks.

  • The NPM postinstall script doesn't work on windows ./
  • Couldn't find the spaceship.zsh even after I managed to get symlinks working
  • node.zsh does a node_version=$(nvm current 2>/dev/null) if nvm exists but on Windows that command (nvm current) doesn't exist. nvm did exist.
  • dir.zsh is somehow trimming the first character of the dir when in a git directory.

Expected behavior

Less headaches

Relevant Zsh configuration (.zshrc)

ZSH_THEME="spaceship"

Environment

Spaceship version: 3.4.1
Zsh version: 5.5.1
Zsh framework: oh-my-zsh
Zsh plugin manager: oh-my-zsh
Terminal emulator: Hyper w/ MSYS2 x64
Operating system: Windows 10

Possible solution

Steps I used to get it working:

  1. Cloned using git clone https://github.com/denysdovhan/spaceship-prompt.git "$ZSH_CUSTOM/themes/spaceship-prompt"
  2. Renamed spaceship.zsh-theme to `spaceship.zsh-theme.old
  3. Renamed spaceship.zsh to spaceship.zsh-theme
  4. Used ZSH_THEME="spaceship-prompt/spaceship instead of `ZSH_THEME="spaceship" (Similar to how powerlevel9k works
  5. Modified node.zsh to not use nvm current for the check.
  6. Modified dir.zsh to use " $dir" \ instead of "$dir" \. (NOTE: this does actually shift the prompt)
good first issue help-wanted question windows

Most helpful comment

We don't actually support Windows. Most of our Windows users just take their own responsibility for their setup and fixing possible issues related to the Windows platform.

However, we can keep this open for other people who struggle with Windows. Maybe together we can improve Windows support and make it easier to set up.

All 2 comments

We don't actually support Windows. Most of our Windows users just take their own responsibility for their setup and fixing possible issues related to the Windows platform.

However, we can keep this open for other people who struggle with Windows. Maybe together we can improve Windows support and make it easier to set up.

Since this issue is quite generic on its title, I'd like to ask for a minor correction that would allow me to use the theme properly.

Currently I'm using ZSH / OMZ inside Cmder which runs a cygwin-mintty profile. All's been good except that I had to use Nvm for Windows instead of zsh-nvm which gave me this for the Node version:
Screenshot_1

Instead of the simple version number. If I use zsh-nvm it shows properly but there are other issues with that.

I believe this should not be too difficult to fix? This is currently the only issue preventing me from using the theme on my Win setup.

Thanks in advance,

Was this page helpful?
0 / 5 - 0 ratings

Related issues

salmanulfarzy picture salmanulfarzy  路  3Comments

vburojevic picture vburojevic  路  3Comments

AlecRust picture AlecRust  路  3Comments

JounQin picture JounQin  路  3Comments

nfischer picture nfischer  路  3Comments