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: IDLE: Pressing "Home" on Windows places cursor before ">>>" instead of after. Solution offered.
Type: behavior Stage: resolved
Components: IDLE Versions: Python 3.0, Python 3.1
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: kbk Nosy List: gpolo, kbk, python-dev, roger.serwy, terry.reedy, weeble
Priority: normal Keywords: patch

Created on 2008-09-12 20:15 by roger.serwy, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (12)
msg73137 - (view) Author: Roger Serwy (roger.serwy) * (Python committer) Date: 2008-09-12 20:20
Pressing "Home" on Windows XP in the PyShell window places the cursor
before ">>>" instead of after it. On Linux, this behaves correctly.

The problem is in PyShell.py in the home_callback(). At line 1064:

if event.state != 0 and event.keysym == "Home":
    return

"event.state" returns 8 on Windows when Home is pressed, thus the
callback never executes. Here are two solutions:

event.mc_state != 0

or

(event.state & 1) != 0

This fixes the problem on Windows, and still works under Linux.
msg73451 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2008-09-20 01:08
This is supposed to have been fixed by
http://bugs.python.org/issue1196903
but I don't believe there has not been a 2.5 release since then.
I do not know if that patch was or was backported for 2.5.
msg85236 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2009-04-02 18:31
As reported in a comment for #2704, the Home key misbehaves on WinXP for
3.0.1.  The 2.6 fix was either not forward ported or otherwise disabled.

I removed 2.5 since that is now on security fix only status.
msg85322 - (view) Author: Kurt B. Kaiser (kbk) * (Python committer) Date: 2009-04-03 20:02
Rev 62545 to 2.6 was forward ported to 3.0 on 4May,
r62716.  I'm using py3k HEAD and it works the same
as 2.6: pressing Home toggles beween the left margin
and the start of the code text.  It works the same way
on Linux and Windows XP.

Won't fix, because this is not a bug, but a feature.
It's useful for copying blocks from the shell.

If you press home to get to the start of the code
text next to the prompt, why did you press it again
except to get to the left margin?  And if you did so
accidentally, press it a third time!
msg85334 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2009-04-03 21:29
The bug reported here is that on Windows XP, on my machine, in 2.5 and
still in multiple releases of 3.0 and 3.0.1, pressing Home sends the
cursor DIRECTLY to the left margin, before '<<<', and never stops at the
beginning of the text, after '>>> '.  I am sorry if I was not clear
enough before.

Toggle behavior would be fine if it happened, and I never said
otherwise.  But it does not happen, at least not on my machine, using
the PSF .msi installer.  There is still a 3.0.2 to come.
msg85374 - (view) Author: Kurt B. Kaiser (kbk) * (Python committer) Date: 2009-04-04 06:32
This wasn't backported to 2.5 as it's trivial and life
is short.

I have a clean install of 3.0.1 from the msi installer,
running on an eeePC 1000HA, XP Home, tk 8.5.

If I type a string at the >>> prompt in the IDLE shell
and hit the home key, the cursor goes to the left of
the string.  A second press puts it at the left margin.
Subseqent presses toggle.

I suggest you do a clean install.  I get the same result
on Linux and XP, for 2.6.1, 3.0.1, 2. HEAD, and 3. HEAD.

If you look at EditorWindow.py:282 in 3.0.1 you can see
the fix.  Please check yours.

Are you saying you have 2.6.1 and 3.0.1 installed and
they act differently?  Do they both show the same version
for Tk?  Please try to find out why 2.6 and 3.0 act
differently on your machine!
msg85376 - (view) Author: Kurt B. Kaiser (kbk) * (Python committer) Date: 2009-04-04 06:51
Weeble found the problem: it's the numlock key interacting
with a bug. I can reproduce it when I latch numlock.
http://bugs.python.org/msg80478
msg85450 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2009-04-05 00:05
Bingo.  I can also switch behaviors with Numlock (which I routinely have
engaged).  Neither of us was crazy ;-)  Thank you 'weeble'.
msg131215 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2011-03-17 04:15
New changeset 664a129c01f7 by Kurt B. Kaiser in branch '2.7':
<Home> toggle non-functional when NumLock set.
http://hg.python.org/cpython/rev/664a129c01f7
msg132070 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2011-03-25 04:33
New changeset a7d50a4e124e by Kurt B. Kaiser in branch '3.1':
<Home> toggle non-functional when NumLock set
http://hg.python.org/cpython/rev/a7d50a4e124e
msg132163 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2011-03-25 21:50
New changeset 500e48708470 by Kurt B. Kaiser in branch '2.7':
<Home> toggle failing on Tk 8.5, causing IDLE exits.  Issue 3851.
http://hg.python.org/cpython/rev/500e48708470
msg305453 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2017-11-02 22:11
The problem is back, at least on Windows, in 2.7.14, 3.5.4, 3.6.3, and 3.7.0.  Numlock has no effect.  I open #31930 for this.
History
Date User Action Args
2022-04-11 14:56:39adminsetgithub: 48101
2017-11-02 22:11:50terry.reedysetresolution: accepted -> fixed
messages: + msg305453
stage: resolved
2011-03-25 21:50:42python-devsetmessages: + msg132163
2011-03-25 04:33:03python-devsetmessages: + msg132070
2011-03-17 04:15:10python-devsetnosy: + python-dev
messages: + msg131215
2010-03-25 23:26:28roger.serwysetstatus: open -> closed
2009-04-05 00:05:16terry.reedysetmessages: + msg85450
2009-04-04 06:56:50kbklinkissue4676 superseder
2009-04-04 06:51:08kbksetstatus: pending -> open

nosy: + weeble
messages: + msg85376

resolution: works for me -> accepted
2009-04-04 06:32:13kbksetstatus: open -> pending
resolution: works for me
messages: + msg85374
2009-04-03 21:29:08terry.reedysetstatus: closed -> open
resolution: wont fix -> (no value)
messages: + msg85334
2009-04-03 20:02:58kbksetstatus: open -> closed
assignee: kbk
resolution: wont fix
messages: + msg85322
2009-04-02 18:31:57terry.reedysetnosy: + kbk

messages: + msg85236
versions: + Python 3.0, Python 3.1, - Python 2.5
2008-09-20 01:08:28terry.reedysetnosy: + terry.reedy
messages: + msg73451
2008-09-19 03:17:24gpolosetfiles: - issue_3851.diff
2008-09-19 03:17:18gpolosetmessages: - msg73182
2008-09-13 13:35:48gpolosetfiles: + issue_3851.diff
keywords: + patch
messages: + msg73182
nosy: + gpolo
2008-09-12 20:20:35roger.serwysettype: behavior
messages: + msg73137
components: + IDLE
versions: + Python 2.5
2008-09-12 20:15:21roger.serwycreate