bobf is sharing code with you

Bitbucket is a code hosting site. Unlimited public and private repositories. Free for small teams.

Don't show this again

bobf / bpython http://bpython-interpreter.org/

Fancy curses interface to the Python interpreter

Clone this repository (size: 838.8 KB): HTTPS / SSH
hg clone https://bitbucket.org/bobf/bpython
hg clone ssh://hg@bitbucket.org/bobf/bpython

Issues

#210 Cmd-K does not clear screen

Reported by Nate Silva

On OS X, pressing Command+K clears the screen. In bpython, it appears to work, but the next time a command is issued, bpython will redraw the screen, restoring what had been erased.

Pressing Ctrl-L to clear the screen does work, but is not well-known in OS X (whereas Cmd-K is documented, among other places, as a keyboard shortcut in the Terminal.app menu).

python itself and ipython both handle Cmd-K in the expected way.

Status: wontfix Responsible: nobody Type: bug Priority: minor
Milestone: none Component: none Version: none

Attachments

No attachments added for this issue yet.

Comments and changes

  1. #1 Sebastian Ramacher

    written

    • Changed status from new to wontfix.

    You can use the config to remap the keys. Use something like

    [keyboard]
    clear_screen = C-k
    cut_to_buffer = XX
    

    You have to remap cut_to_buffer too, otherwise C-k would mean two different things and that won't work. Note that after remapping the keys that you can't clear the screen with C-l anymore.

    I set the state to wontfix since we're using readline mappings as default here and (at least) I don't want to diverge from them.

  2. #2 Nate Silva

    written

    Note that will remap Ctrl-K, not Cmd-K. Is there a way to remap Cmd-K? The documentation only mentions Ctrl+char and the F-keys.

    The main issue is that bpython redraws the screen. Cmd-K actually does clear the screen, but then bpython redraws it with the previous content. When you press Ctrl-L it also seems to clear bpython’s screen-redraw buffer, which is the desired behavior.

    Regards, Nate

Add comment / attachment

Verification: Please write the text from the image in the box (letters only)

captcha

Is that you, Humanoid? Is this me?