Reputation: 356
AutoHotKey cannot insert numbers on the WSL unless I use codepoints
I would like to use python3
every time I use pipenv
. For that, I need to insert: pip --python /usr/bin/python3 etc.
. However, I don't want to type --python /usr/bin/python3
every time, and therefore I have automated that part with an AutoHotKey script.
The following line works fine when I type the hotstring in any place such as a Notepad file or a path bar:
::pipenv::pipenv --python /usr/bin/python3
When I type pipenv
in, say, Notepad, the string pipenv --python /usr/bin/python3
is inserted.
However, if I type it on the WSL (Windows Subsytem for Linux), then I get:
pipenv 66python LusrLbinLpython·
I get the same result in CMD, but surprisingly not in PowerShell (where I get the expected output).
To make it work on the command line, I had to re-write my script using hexadecimal codepoints (or entity references, not sure what the proper name is) instead of the characters themselves:
::pipenv::pipenv {U+2D}{U+2D}python {U+2F}usr{U+2F}bin{U+2F}python{U+33}
That way the output is the expected pipenv --python /usr/bin/python3
both on the command line and in any other environment. I'm surprised that this is the case, because those characters (-
, /
and 3
) are normal ASCII characters, so I don't understand why using codepoints is necessary.
The AutoHotKey script contains UTF-8 Unicode (with BOM) text, with CRLF line terminators.
In a nutshell, I have managed to make the script work. The reason for opening this question is to understand why this happens. Thanks.
Upvotes: 2
Views: 119