fix parse_history regex when sequence exeeds 9999#33
fix parse_history regex when sequence exeeds 9999#33dotslash merged 1 commit intodotslash:masterfrom
Conversation
Match zero or more characters of whitespace at the beginning of lines when parsing `history 1` output.
|
Hi @awaxa , |
|
Remove the needs-info label after you clarify :) |
|
Note: I use When my .bash_history file reached 10000 lines and my shell would evaluate the PARSE_COMMAND, I started seeing the parse error warning message. The if statement in the log function would evaluate to False because the re.match in the parse_history function had stopped returning its capture groups. Since the value of the history argument for the parse_history function is provided by the output from a subshell in the PROMPT_COMMAND, I noticed that the format of this output had changed with respect to the regular expression in parse_history. The command Here's a sample of .bash_history lines 9998-10001 as formatted by the history command, from Notice that there is a space at beginning of the history output until line number 10000, and after that the output begins with the line number with no spaces. The expression in the re.match statement in parse_history was defined as This commit changes the first With this fix, I am able to continue parsing history for .recent.db even when my .bash_history file is over 9999 lines in length. |
|
Thanks for the super detailed explanation :) I have a few other changes in mind in the coming few days. I will batch push pypi after that. |
Match zero or more characters of whitespace at the beginning of lines when parsing
history 1output.This fixed my issue where the
parse_historyfunction stopped working once my history reached 10000 lines.