Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix treatment of slashes (path separator) by history command #107

Merged
merged 1 commit into from
Aug 24, 2024

Conversation

rakitzis
Copy link
Owner

This change fixes the history pruning treatment of a slash character in the history followed by the name of the history command.

The purpose of pruning is to avoid recursion in the history rewind, so history lines with a history command in them are pruned away in the search.

With the history command named as "-", previously a history line like:

    find / --option

would have been pruned (too aggressively). The change trims whitespace after first considering the case of whitespace separating a slash and the name of the history command.

A few basic unit tests for the history command are also added with this commit.

This change fixes the history pruning treatment of a slash
character in the history followed by the name of the history
command.

The purpose of pruning is to avoid recursion in the history
rewind, so history lines with a history command in them are
pruned away in the search.

With the history command named as "-", previously a history
line like:

        find / --option

would have been pruned (too aggressively). The change trims
whitespace after first considering the case of whitespace
separating a slash and the name of the history command.

A few basic unit tests for the history command are also added
with this commit.
@rakitzis
Copy link
Owner Author

Fixes #104

@rakitzis rakitzis merged commit 4540368 into master Aug 24, 2024
4 checks passed
@gitboy
Copy link

gitboy commented Aug 25, 2024

thanks for fixing this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants