如何在WSL2(Ubuntu)中运行的vscode中设置powerline-go

时间:2019-12-10 13:52:46

标签: visual-studio-code windows-subsystem-for-linux vscode-remote

这些是我的~/.vscode-server/server-env-setup

的内容
function _update_ps1() {
    PS1="$($GOPATH/bin/powerline-go -error $?)"
}
if [ "$TERM" != "linux" ] && [ -f "$GOPATH/bin/powerline-go" ]; then
   PROMPT_COMMAND="_update_ps1; $PROMPT_COMMAND"
fi

...给出此错误

[2019-12-10 13:49:39.763] /mnt/c/Users/cber/.vscode/extensions/ms-vscode-remote.remote-wsl-0.40.3/scripts/wslServer.sh: 1: /home/cber/.vscode-server/server-env-setup: Syntax error: "(" unexpected
[2019-12-10 13:49:39.805] VS Code Server for WSL closed unexpectedly.

更新

此版本(剥离Windows行尾)不会产生任何错误,但不幸的是,它也不会在git repo的提示符中显示任何内容:

GOPATH=$HOME/go
_update_ps1() {
    PS1="$($GOPATH/bin/powerline-go -error $?)"
}
if [ "$TERM" != "linux" ] && [ -f "$GOPATH/bin/powerline-go" ]; then
   PROMPT_COMMAND="_update_ps1; $PROMPT_COMMAND"
fi

0 个答案:

没有答案