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

Use native readline function for new history file #417

Merged
merged 1 commit into from
Jun 28, 2024

Conversation

ItsDrike
Copy link
Contributor

In commit 07bcbe5 an issue described in python/cpython#105694 was solved by changing the pythonrc script and adding:

with open(history,\"w\") as f:
    f.write(\"_HiStOrY_V2_\" + \"\\n\\n\") # breaks on macos + python3 without this.

Even though this does indeed solve the issue, it's really ugly code-wise, and there is a built-in way to do this in the readline library, with:

readline.write_history_file(str(history)) # breaks on macos + python3 without this.

This PR just edits the script to use that instead.

@b3nj5m1n
Copy link
Owner

Thanks!

@b3nj5m1n b3nj5m1n merged commit 6602587 into b3nj5m1n:main Jun 28, 2024
1 check passed
@ItsDrike ItsDrike deleted the use-readline-for-new-history-file branch June 28, 2024 14:55
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