I've found some weird behavior of FileNameCompleter on the app for Windows OS. When I try to complete a path to the file in Win console, JLine just ignores backslashes.
Example
$> operation C:\Some\Folder\File.zip
The app completes this path well, but in FileNameCompleter, I see a cleaned from backslashes buffer like this
and as result readLine() method returns a string without backslashes. To avoid such behavior I need to use double backslashes in the path (a customization of FileNameCompleter is needed here).
$> operation C:\\Some\\Folder\\File.zip
I also found this explanation:
A backslash - like is used in a file path - can't be used directly in a Java String. Java uses the backslash to mean “the next character means something special”. Doubling the backslash in Java indicates that “the next character (the second backslash) should be inserted into the String”.
Maybe there is some solution of this issue in Jline out the box which I just overlooked? Maybe some option which I need to activate to force JLine understand single backslashes?
I've found some weird behavior of
FileNameCompleteron the app for Windows OS. When I try to complete a path to the file in Win console, JLine just ignores backslashes.Example
The app completes this path well, but in
FileNameCompleter, I see a cleaned from backslashes buffer like thisand as result
readLine()method returns a string without backslashes. To avoid such behavior I need to use double backslashes in the path (a customization ofFileNameCompleteris needed here).I also found this explanation:
Maybe there is some solution of this issue in Jline out the box which I just overlooked? Maybe some option which I need to activate to force JLine understand single backslashes?