Skip to content

Prompt and history #695

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

Closed
6r1d opened this issue Jul 27, 2018 · 1 comment
Closed

Prompt and history #695

6r1d opened this issue Jul 27, 2018 · 1 comment

Comments

@6r1d
Copy link
Contributor

6r1d commented Jul 27, 2018

If I understand correctly, ptpython is using a buffer to interact with user and FileHistory is just connected to the buffer itself.

So, for instance, how should I change autocompletion.py example to make it function as a prompt and have a history, which reacts to "up" and "down" buttons?

@6r1d
Copy link
Contributor Author

6r1d commented Jul 29, 2018

#614 has an answer.
Source explains a lot, too:

    @handle('enter', filter=focused)
    def _(event):
        " Run system command. "
        # ...
        self.system_buffer.reset(append_to_history=True)
        # ...

@6r1d 6r1d closed this as completed Jul 29, 2018
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

No branches or pull requests

1 participant