wting / autojump

A cd command that learns - easily navigate directories from the command line
Other
16.3k stars 706 forks source link

[Windows] Path is encoded and can't be jumped onto #279

Open ceilfors opened 10 years ago

ceilfors commented 10 years ago

The issue is caused by the autojump_utils#encode_local that is called by print_local. When I change the print_local to normal python print function, autojump works in Windows.

_Result of autojump.py with printlocal (broken) b'C:\j\foo'

Result of autojump.py with print (fixed) C:\j\foo

This issue is happening for tab completion too + other features of autojump.

Debugging information String before encode_local: C:\j\foo After encoded with utf-8: b'C:\j\foo' After encoded with sys.getfilesystemencoding(): b'C:\j\foo' Value of sys.getfilesystemencoding(): mbcs

Environment Windows 7 64-bit

Symptom autojump.txt writing is successful (contains data) Error message: autojump: directory foo not found try autojump --help for more information

ceilfors commented 10 years ago

Workaround to use autojump in Windows (Only the j command)

  1. Open C:\Users{user}\AppData\Local\autojump\bin\autojump file
  2. Replace all print_local with print

Wondering if @mdlawson have any clues on this issue.