Closed con-f-use closed 5 years ago
The last commit was not (yet) thorough tested. Will try to in the future unless someone else is faster.
Should I consider this WIP or is it ready to go?
How does the original script handle this? The data format was chosen to maintain compatibility with the original script.
The original script doesn't and neither does fasd
(which is supposed to be an improvement). Both just write the path "as is" and then ignore any invalid directories that resutlt form it. They just don't cd
into them and give no error message. The invalid lines stay in the file.
It's still a WIP, but I'll probably finish today.
Okay, now it is done and ready for merge.
Works around corrupted data files that would otherwise throw an exception on every command execution entered in any xonsh shell that has xontrib-z activated.
This happened to me, when I changed dir into a folder that had a newline in it. The resulting data-file looked something like this:
Note the superfuous linebreak in the 4th line after
/tmp/data_is_
and how the line continues withxs2|29|1554672999
. Results in a traceback on every command executed in shell.If I find the the time, I will modify the
save_data
andload_data
function so it escapes resp. unescapes special characters. I think escaping the pipe\|
and newline\n
should be sufficient, but there might be other weird special cases like terminal bell, backspace and the like.