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

Not working in WSL #13

Open
aravindvnair99 opened this issue Jun 17, 2021 · 4 comments
Open

Not working in WSL #13

aravindvnair99 opened this issue Jun 17, 2021 · 4 comments

Comments

@aravindvnair99
Copy link

I get the following error on WSL:

: command not found
bash: /home/<username here>/bash-wakatime.sh: line 12: syntax error near unexpected token `$'{\r''
'ash: /home/<username here>/bash-wakatime.sh: line 12: `pre_prompt_command() {

This used to work fine in Git Bash. I recently came over to WSL2 and I am unable to get it to work.

@irondoge
Copy link
Owner

Hi, unfortunately I will not be of much help for you as I am not a windows user. However have a look at the default shell setting of your WSL distribution to make sure it's really using bash and if it's a recent version.
Cheers

@aravindvnair99
Copy link
Author

Hi, unfortunately I will not be of much help for you as I am not a windows user. However have a look at the default shell setting of your WSL distribution to make sure it's really using bash and if it's a recent version.
Cheers

@irondoge Thanks for your response! I'm on bash itself and the version is 5.1.4

@aravindvnair99
Copy link
Author

@irondoge Here's some output from my WSL:

user@host:~$ ps -p $$
  PID TTY          TIME CMD
   82 pts/1    00:00:00 bash
user@host:~$ echo $SHELL
/bin/bash
user@host:~$ /bin/bash --version
GNU bash, version 5.1.4(1)-release (x86_64-pc-linux-gnu)
Copyright (C) 2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>

This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
user@host:~$ which bash
/usr/bin/bash
user@host:~$ /usr/bin/bash --version
GNU bash, version 5.1.4(1)-release (x86_64-pc-linux-gnu)
Copyright (C) 2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>

This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
user@host:~$ bash --version
GNU bash, version 5.1.4(1)-release (x86_64-pc-linux-gnu)
Copyright (C) 2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>

This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

@Freed-Wu
Copy link

I think I know what happened. windows use \r\n (CR, LF) as its EOL, but unix use \n (LF). bash only support the latter. You download this project in windows by git-for-windows and it uses \r\n as its EOL, which cannot be recognized by bash. It is not the bug of this project so the issue can be closed. Just download the code in WSL everything will go well.

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

No branches or pull requests

3 participants