Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clear error after first not working. [WSL2] #303

Open
ntaken opened this issue Mar 29, 2021 · 1 comment
Open

Clear error after first not working. [WSL2] #303

ntaken opened this issue Mar 29, 2021 · 1 comment
Labels

Comments

@ntaken
Copy link

ntaken commented Mar 29, 2021

Describe the bug
The copied command do not seems to work.

    # Uncomment the following line to automatically clear errors after showing
    # them once. This not only clears the error for powerline-go, but also for
    # everything else you run in that shell. Don't enable this if you're not
    # sure this is what you want.

    #set "?"

To Reproduce
Steps to reproduce the behavior:

  1. Uncomment #set "?" to set "?" in .bashrc

and from different shell (like powershell) restart Ubuntu

  1. wsl -terminate Ubuntu

  2. Open again Ubuntu

  3. Produce a error and press enter

  4. The errors will keep repeting till you insert a successful command.

Expected behavior
Errors should stop repeting after showing once.

Environment (please complete the following information):

  • OS: Ubuntu 20.04
  • Architecture: amd64
  • Shell: Bash
  • WSL2
@ntaken ntaken added the bug label Mar 29, 2021
@rickysarraf
Copy link

I have the same problem on native Debian Linux.

# powerline-go
function _update_ps1_powerline_go() {
    #PS1="$($GOPATH/bin/powerline-go -error $? -jobs $(jobs -p | wc -l))"
    PS1="$(powerline-go \
            -error $? \
            -jobs $(jobs -p | wc -l) \
            -numeric-exit-codes \
            -hostname-only-if-ssh \
            -shell-var PROMPT_SYMBOLS \
            -modules "time,venv,user,host,ssh,cwd,perms,jobs,newline,shell-var,git,hg,exit,direnv,docker,docker-context,dotenv,root"
            )"

    # Uncomment the following line to automatically clear errors after showing
    # them once. This not only clears the error for powerline-go, but also for
    # everything else you run in that shell. Don't enable this if you're not
    # sure this is what you want.

    set "?"
}

if [ "$TERM" != "linux" ] && [ -f "$GOPATH/bin/powerline-go" ]; then
    PROMPT_COMMAND="_update_ps1_powerline_go; $PROMPT_COMMAND"
fi

while the effect is not the same.

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants