This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Create IDLE Modern Mac keyset
Type: Stage: needs patch
Components: IDLE Versions: Python 3.11
process
Status: closed Resolution: duplicate
Dependencies: Superseder: IDLE: Revise macOS key bindings, make new one.
View: 18444
Assigned To: terry.reedy Nosy List: cheryl.sabella, ned.deily, rhettinger, terry.reedy
Priority: normal Keywords:

Created on 2018-02-03 22:24 by rhettinger, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Messages (5)
msg311575 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2018-02-03 22:24
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).
msg311610 - (view) Author: Cheryl Sabella (cheryl.sabella) * (Python committer) Date: 2018-02-04 17:15
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.
msg311648 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2018-02-05 08:06
Mac key bindings and Shell home method behavior are separate and long-standing issues.  They were discussed together in #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 #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.


2. 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 #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 #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.
msg311866 - (view) Author: Ned Deily (ned.deily) * (Python committer) Date: 2018-02-09 04:28
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!)
msg395599 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2021-06-11 03:58
#18444 is about revising macOS keysets and/or making a new one.  This is about the latter.  So closing as duplicate.
History
Date User Action Args
2022-04-11 14:58:57adminsetgithub: 76942
2021-06-11 03:58:56terry.reedysetstatus: open -> closed
versions: + Python 3.11
superseder: IDLE: Revise macOS key bindings, make new one.
messages: + msg395599

resolution: duplicate
stage: needs patch
2018-02-09 04:28:40ned.deilysetmessages: + msg311866
2018-02-05 08:06:06terry.reedysetnosy: + ned.deily

messages: + msg311648
title: IDLE Keymap for Cntl-A -> Create IDLE Modern Mac keyset
2018-02-04 17:15:28cheryl.sabellasetnosy: + cheryl.sabella
messages: + msg311610
2018-02-03 22:24:20rhettingercreate