You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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=<Date2021-06-11.03:58:56.672>created_at=<Date2018-02-03.22:24:20.458>labels= ['expert-IDLE', '3.11']
title='Create IDLE Modern Mac keyset'updated_at=<Date2021-06-11.03:58:56.668>user='https://github.com/rhettinger'
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).
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.
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.
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>
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.
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.
Activity
rhettinger commentedon Feb 3, 2018
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.
csabella commentedon 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 commentedon Feb 5, 2018
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.
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.
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.
[-]IDLE Keymap for Cntl-A[/-][+]Create IDLE Modern Mac keyset[/+]ned-deily commentedon Feb 9, 2018
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 commentedon Jun 11, 2021
bpo-18444 is about revising macOS keysets and/or making a new one. This is about the latter. So closing as duplicate.