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

Create IDLE Modern Mac keyset #76942

Closed
rhettinger opened this issue Feb 3, 2018 · 5 comments
Closed

Create IDLE Modern Mac keyset #76942

rhettinger opened this issue Feb 3, 2018 · 5 comments
Assignees
Labels
3.11 only security fixes topic-IDLE

Comments

@rhettinger
Copy link
Contributor

BPO 32761
Nosy @rhettinger, @terryjreedy, @ned-deily, @csabella
Superseder
  • bpo-18444: IDLE: Revise macOS key bindings, make new one.
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = 'https://github.com/terryjreedy'
    closed_at = <Date 2021-06-11.03:58:56.672>
    created_at = <Date 2018-02-03.22:24:20.458>
    labels = ['expert-IDLE', '3.11']
    title = 'Create IDLE Modern Mac keyset'
    updated_at = <Date 2021-06-11.03:58:56.668>
    user = 'https://github.com/rhettinger'

    bugs.python.org fields:

    activity = <Date 2021-06-11.03:58:56.668>
    actor = 'terry.reedy'
    assignee = 'terry.reedy'
    closed = True
    closed_date = <Date 2021-06-11.03:58:56.672>
    closer = 'terry.reedy'
    components = ['IDLE']
    creation = <Date 2018-02-03.22:24:20.458>
    creator = 'rhettinger'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 32761
    keywords = []
    message_count = 5.0
    messages = ['311575', '311610', '311648', '311866', '395599']
    nosy_count = 4.0
    nosy_names = ['rhettinger', 'terry.reedy', 'ned.deily', 'cheryl.sabella']
    pr_nums = []
    priority = 'normal'
    resolution = 'duplicate'
    stage = 'needs patch'
    status = 'closed'
    superseder = '18444'
    type = None
    url = 'https://bugs.python.org/issue32761'
    versions = ['Python 3.11']

    @rhettinger
    Copy link
    Contributor Author

    The default keymap for Cntl-A should be <beginning-of-line>, the same as Cntl-KeyLeft. This is consistent with how Cntl-A behaves at the bash prompt and in Emacs.

    >>> print('Hello World')
        ^--- Cntl-A should take you here
    ^------- Cntl-A currently takes you here (which is never helpful).

    @csabella
    Copy link
    Contributor

    csabella commented Feb 4, 2018

    That's interesting. I've always thought of Control+A to be 'select all'.

    https://en.wikipedia.org/wiki/Table_of_keyboard_shortcuts

    Do you think a new keybinding theme should be added for bash/emacs? I don't know how well emacs would work without allowing combinations like Control+X, Control-F.

    @terryjreedy
    Copy link
    Member

    Mac key bindings and Shell home method behavior are separate and long-standing issues. They were discussed together in bpo-18444, and this could be considered a duplicate thereof. However, the two issues need to be discussed and solved separately.

    1. The bindings of <Control-Key-A> and <<beginning-of-line>> on Macs. The more general issue is IDLE key bindings on MacOSX.

    Here are the beginning-of-line and select-all bindings in the various keysets.

    From idlelib/config-keys.def
    [IDLE Classic Windows]
    beginning-of-line= <Key-Home>
    select-all=<Control-Key-a> <Control-Key-A>

    [IDLE Classic Unix]
    beginning-of-line=<Control-Key-a> <Key-Home>
    select-all=<Alt-Key-a> <Meta-Key-a>

    [IDLE Modern Unix] # default on *nix, design by Serhiy Storchaka
    beginning-of-line = <Key-Home>
    select-all = <Control-Key-a>

    [IDLE Classic Mac] # so obsolete that it almost should be removed?
    beginning-of-line= <Key-Home>
    select-all=<Command-Key-a>

    [IDLE Classic OSX]
    beginning-of-line = <Control-Key-Left>
    select-all = <Command-Key-a>

    I am guessing that Raymond is using a Mac and a customized version of IDLE Classic OSX with Control-Key-A added as either *a* or *the* binding of the <<beginning-of-line pseudoevent. On bpo-18444, I asked whether we should make this addition config-key.def. (No answer there.) I now realize that doing so would break any custom keyset that binds ^A to any other pseudoevent. So I would be very reluctant to change the current keyset.

    On the same issue, Ned suggested (July 2013) that even the OSX keyset had multiple problems and should be replaced. A new keyset would have to be justified by more than one change, but would not be encumbered by back compatibility. Are standards stable enough on Mac to make a new keyset appropriate now?

    In June 2016, Serhiy Storchaka posted a new keyset for Linux that he claimed followed current Linux standards, such as they are. It is now the default on Linux. I would do the same for Mac if Ned and Raymond agreed on something. I changed the title of this issue to this generalization, rather than close it as a duplicate.

    1. The behavior of editor.EditorWindow.home_callback, bound to <beginning-of-line>, in Shell. Jumping to the physical start of line was fixed, at least on *nix and Windows, in bpo-3851. I remember verifying this. Yet now, on Win 10, the old behavior is back. So, this is not only a Mac issue and this part is a duplicate of bpo-31930.

    The underlying issue is the mixing of a read-only prompt and the first line of a possibly multiline read-write Python statement in the Shell text widget. This also leads to the indent problem and a couple of other minor issues. In retrospect, I consider this mixing a design mistake and I am working on a suggestion about fixing it.

    @terryjreedy terryjreedy changed the title IDLE Keymap for Cntl-A Create IDLE Modern Mac keyset Feb 5, 2018
    @ned-deily
    Copy link
    Member

    Terry, it would be better to get opinions from others who really use IDLE on macOS. But, FWIW:

    • I agree with Raymond that Ctrl-A makes much more sense as the default for beginning of line for the reasons he cites.

    • Command-A is appropriate for select-all.

    • Should the Classic Mac keyset be removed? Probably

    • Designing a more modern macOS keyset is probably still a good idea (but I'm not volunteering to do it!)

    @terryjreedy
    Copy link
    Member

    bpo-18444 is about revising macOS keysets and/or making a new one. This is about the latter. So closing as duplicate.

    @terryjreedy terryjreedy added the 3.11 only security fixes label Jun 11, 2021
    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    3.11 only security fixes topic-IDLE
    Projects
    None yet
    Development

    No branches or pull requests

    4 participants