Skip to content

IDLE: Pressing "Home" on Windows places cursor before ">>>" instead of after. Solution offered. #48101

Closed

Description

@serwy
mannequin
BPO 3851
Nosy @terryjreedy, @kbkaiser, @serwy

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/kbkaiser'
closed_at = <Date 2010-03-25.23:26:28.000>
created_at = <Date 2008-09-12.20:15:21.397>
labels = ['expert-IDLE', 'type-bug']
title = 'IDLE: Pressing "Home" on Windows places cursor before ">>>" instead of after. Solution offered.'
updated_at = <Date 2017-11-02.22:11:50.012>
user = 'https://github.com/serwy'

bugs.python.org fields:

activity = <Date 2017-11-02.22:11:50.012>
actor = 'terry.reedy'
assignee = 'kbk'
closed = True
closed_date = <Date 2010-03-25.23:26:28.000>
closer = 'roger.serwy'
components = ['IDLE']
creation = <Date 2008-09-12.20:15:21.397>
creator = 'roger.serwy'
dependencies = []
files = []
hgrepos = []
issue_num = 3851
keywords = ['patch']
message_count = 12.0
messages = ['73137', '73451', '85236', '85322', '85334', '85374', '85376', '85450', '131215', '132070', '132163', '305453']
nosy_count = 6.0
nosy_names = ['terry.reedy', 'kbk', 'gpolo', 'roger.serwy', 'weeble', 'python-dev']
pr_nums = []
priority = 'normal'
resolution = 'fixed'
stage = 'resolved'
status = 'closed'
superseder = None
type = 'behavior'
url = 'https://bugs.python.org/issue3851'
versions = ['Python 3.0', 'Python 3.1']

Activity

  1. serwy commented on Sep 12, 2008

    serwymannequin
    MannequinAuthor

    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.

  2. terryjreedy commented on Sep 20, 2008

    @terryjreedy
    Member

    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.

  3. terryjreedy commented on Apr 2, 2009

    @terryjreedy
    Member

    As reported in a comment for bpo-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.

  4. kbkaiser commented on Apr 3, 2009

    @kbkaiser
    Contributor

    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!

  5. self-assigned this
    on Apr 3, 2009
  6. terryjreedy commented on Apr 3, 2009

    @terryjreedy
    Member
    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.

  7. kbkaiser commented on Apr 4, 2009

    @kbkaiser
    Contributor

    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!

  8. kbkaiser commented on Apr 4, 2009

    @kbkaiser
    Contributor

    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

  9. terryjreedy commented on Apr 5, 2009

    @terryjreedy
    Member

    Bingo. I can also switch behaviors with Numlock (which I routinely have
    engaged). Neither of us was crazy ;-) Thank you 'weeble'.

  10. python-dev commented on Mar 17, 2011

    python-devmannequin
    Mannequin

    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

  11. python-dev commented on Mar 25, 2011

    python-devmannequin
    Mannequin

    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

  12. python-dev commented on Mar 25, 2011

    python-devmannequin
    Mannequin

    New changeset 500e48708470 by Kurt B. Kaiser in branch '2.7':
    <Home> toggle failing on Tk 8.5, causing IDLE exits. bpo-3851.
    http://hg.python.org/cpython/rev/500e48708470

  13. terryjreedy commented on Nov 2, 2017

    @terryjreedy
    Member

    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 bpo-31930 for this.

  14. transferred this issue fromon Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

topic-IDLEtype-bugAn unexpected behavior, bug, or error

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions