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

IDLE: add cursor noblink option #48880

Closed
mark-summerfield mannequin opened this issue Dec 11, 2008 · 24 comments
Closed

IDLE: add cursor noblink option #48880

mark-summerfield mannequin opened this issue Dec 11, 2008 · 24 comments
Assignees
Labels
3.10 only security fixes topic-IDLE type-feature A feature request or enhancement

Comments

@mark-summerfield
Copy link
Mannequin

mark-summerfield mannequin commented Dec 11, 2008

BPO 4630
Nosy @terryjreedy, @mark-summerfield, @serwy, @rovitotv, @ZackerySpytz, @miss-islington
PRs
  • bpo-4630: Add cursor no-blink option for IDLE #16960
  • [3.8] bpo-4630: Add cursor no-blink option for IDLE (GH-16960) #17141
  • [3.7] bpo-4630: Add cursor no-blink option for IDLE (GH-16960) #17142
  • bpo-4630: Fix errors in Lib/idlelib/NEWS.txt #21594
  • [3.9] bpo-4630: Fix errors in Lib/idlelib/NEWS.txt (GH-21594) #21598
  • [3.8] bpo-4630: Fix errors in Lib/idlelib/NEWS.txt (GH-21594)  #21599
  • Files
  • issue_4630.diff
  • issue4630_refreshed.patch
  • 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 2020-07-23.08:20:12.743>
    created_at = <Date 2008-12-11.08:05:53.196>
    labels = ['expert-IDLE', 'type-feature', '3.10']
    title = 'IDLE: add cursor noblink option'
    updated_at = <Date 2020-07-23.08:20:12.742>
    user = 'https://github.com/mark-summerfield'

    bugs.python.org fields:

    activity = <Date 2020-07-23.08:20:12.742>
    actor = 'terry.reedy'
    assignee = 'terry.reedy'
    closed = True
    closed_date = <Date 2020-07-23.08:20:12.743>
    closer = 'terry.reedy'
    components = ['IDLE']
    creation = <Date 2008-12-11.08:05:53.196>
    creator = 'mark'
    dependencies = []
    files = ['13454', '29787']
    hgrepos = []
    issue_num = 4630
    keywords = ['patch']
    message_count = 24.0
    messages = ['77598', '77720', '84056', '84061', '84073', '84074', '84285', '84366', '84371', '84522', '150937', '151045', '186589', '186611', '286494', '355521', '356516', '356517', '356518', '356520', '356521', '374122', '374125', '374128']
    nosy_count = 10.0
    nosy_names = ['terry.reedy', 'donmez', 'mark', 'gpolo', 'roger.serwy', 'decaf', 'Todd.Rovito', 'bughunter2', 'ZackerySpytz', 'miss-islington']
    pr_nums = ['16960', '17141', '17142', '21594', '21598', '21599']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue4630'
    versions = ['Python 3.10']

    @mark-summerfield
    Copy link
    Mannequin Author

    mark-summerfield mannequin commented Dec 11, 2008

    IDLE's cursor blinks with Python 3.0 on Linux.

    But it shouldn't (and doesn't for prior versions) because in my
    .Xdefaults file I have the line:
    *insertOffTime: 0

    Now I have to manually edit idlelib/EditorWindow.py to stop the cursor
    from blinking.
    (I also have to do this on Windows because IDLE ignores the blink rate
    set in the control panel.)

    I am one of a minority of people who cannot work with blinking cursors.
    I hope that at the least IDLE will get an option to switch it off.

    @mark-summerfield mark-summerfield mannequin added the topic-IDLE label Dec 11, 2008
    @mark-summerfield
    Copy link
    Mannequin Author

    mark-summerfield mannequin commented Dec 13, 2008

    Although I stand by my criticism of IDLE not offering the option of
    switching off cursor blink, I've now discovered that the problem was
    with Fedora 10 no longer executing xrdb .Xdefaults; once I added that
    line to my .bash_profile the cursor blinking stopped.

    However, that is no help to people using Windows for whom the only
    solution is to manually edit the EditorWindow.py file every time they
    install a new version of Python.

    @decaf
    Copy link
    Mannequin

    decaf mannequin commented Mar 24, 2009

    Would you please share that code with us.

    @mark-summerfield
    Copy link
    Mannequin Author

    mark-summerfield mannequin commented Mar 24, 2009

    Py2.6: idlelib/EditorWindow.py

    change line 110 from: width=self.width,
    to: width=self.width, insertofftime=0,

    Py3.0
    apply the same change to line 112

    This will switch off cursor blink (and annoy people who want cursor
    blink). So really instead of setting it to 0 you should set it to a
    variable. On Windows the Win32 API has a function you can call to find
    out the user's preferred blink rate and you can use that. On Mac OS X
    there's no such thing so you would need to add an option to IDLE's
    configuration dialog. On Linux the .Xdefaults file should be read and
    *insertOffTime respected. But since for Mac you have to add it to the
    configuration dialog, it might just be easier to just do that for all
    platform a simple [ ] blinking cursor check box would suffice.

    @decaf
    Copy link
    Mannequin

    decaf mannequin commented Mar 24, 2009

    Thank you very much. It was a kind of chinese torture.

    @mark-summerfield
    Copy link
    Mannequin Author

    mark-summerfield mannequin commented Mar 24, 2009

    Yes, blinking cursors are torture for me too. Fortunately you can switch
    them off globally in Windows, and in most cases on Linux (which is what
    I use). But not on Mac OS X, and not it seems for Java apps. This site
    has some tips: http://www.jurta.org/en/prog/noblink

    @gpolo
    Copy link
    Mannequin

    gpolo mannequin commented Mar 27, 2009

    Maybe we can agree on the feature being added ? I don't see much use for
    controlling how much time the insertion cursor is on and how much time
    it is off, but maybe just choosing between blink and no-blink would be
    good to have. I would prefer to just get an option inside the "General"
    tab that would affect the Text widget creation, instead of depending on
    how each platform changes the behaviour.

    I personally didn't have any issue with seeing the cursor blinking (I
    think I never watched it blinking carefully), but now that you say this
    it does annoy me if I watch it :)

    @gpolo gpolo mannequin added the type-feature A feature request or enhancement label Mar 27, 2009
    @mark-summerfield
    Copy link
    Mannequin Author

    mark-summerfield mannequin commented Mar 29, 2009

    I agree that control of the blink _rate_ isn't needed. I would certainly
    welcome a "[X] blinking cursor" checkbox that defaulted to being checked
    so that existing behaviour is unchanged, but at the same time offering
    an easier solution (i.e., no blinking if the user unchecks & of course
    saving and restoring this setting with the other IDLE settings) for
    those of us who can't work with cursor blink instead of forcing us to
    edit EditWindow.py for every version of Python we install on all our
    partitions & machines.

    @gpolo
    Copy link
    Mannequin

    gpolo mannequin commented Mar 29, 2009

    Here is a patch.

    But I'm not feeling comfortable with the option "display":

    Cursor blink ( ) No blink ( ) Blink

    Those are radiobuttons. If I opted for a checkbutton then it would be
    different from everything on the "General" config, still..

    @mark-summerfield
    Copy link
    Mannequin Author

    mark-summerfield mannequin commented Mar 30, 2009

    I think a checkbox would be better:
    [X] Blinking cursor

    or

    [X] Cursor blink

    but if you use radio buttons you could have:

    Cursor blink (*) On ( ) Off

    @bughunter2
    Copy link
    Mannequin

    bughunter2 mannequin commented Jan 9, 2012

    I, too, would like to see this as an option in IDLE, as I also find blinking cursors distracting.

    I can confirm that tkinter.Text's "insertofftime" option works on Windows as well, so the proposed patch should work on Windows.

    @terryjreedy
    Copy link
    Member

    The idea and design look good to me. I will test on Windows when I am able to do so in development builds (unless someone beats me ;-).

    @terryjreedy terryjreedy changed the title IDLE no longer respects .Xdefaults insertOffTime IDLE: add cursor noblink option Jan 11, 2012
    @donmez
    Copy link
    Mannequin

    donmez mannequin commented Apr 11, 2013

    Time to say ping here. This patch is still would be useful for Python.

    @serwy
    Copy link
    Mannequin

    serwy mannequin commented Apr 12, 2013

    Attached is an updated version of the patch against the latest 2.7 code.

    @terryjreedy
    Copy link
    Member

    @terryjreedy terryjreedy added the 3.7 (EOL) end of life label Jan 30, 2017
    @terryjreedy terryjreedy self-assigned this Jan 30, 2017
    @ZackerySpytz
    Copy link
    Mannequin

    ZackerySpytz mannequin commented Oct 28, 2019

    I have created a pull request for this issue.

    @terryjreedy
    Copy link
    Member

    Zackary's patch toggles blinking immediately in editor/shell/output windows, but does not affect the FontSample and numerous dialog entry lines. I changed the patch to store 'insertofftime' just once, as idleConf.blink_off_time. This is set the first time a shell or editor is created.

    This can be used in a future patch to set the option when other cursor widgets are created. (Trying to update all visible or hidden entry lines is too much work.) For dialogs created just once, this will be the next time IDLE is started. Having these blink for the remainder of a session, if used again, should be a minor nuisance compared to blinking in the shell and editors.

    @terryjreedy
    Copy link
    Member

    My intent is that a followup patch should, for font sample and entry widgets, set insertofftime=0 on creation if not cursor_blink. A new idleConf.set_cursor_blink(widget), something like the new EditorWindow.update_cursor_blink could be used multiple places.

    @terryjreedy
    Copy link
    Member

    New changeset 9c28449 by Terry Jan Reedy (Zackery Spytz) in branch 'master':
    bpo-4630: Add cursor no-blink option for IDLE (GH-16960)
    9c28449

    @miss-islington
    Copy link
    Contributor

    New changeset a67bc10 by Miss Islington (bot) in branch '3.8':
    bpo-4630: Add cursor no-blink option for IDLE (GH-16960)
    a67bc10

    @miss-islington
    Copy link
    Contributor

    New changeset 753d0c0 by Miss Islington (bot) in branch '3.7':
    bpo-4630: Add cursor no-blink option for IDLE (GH-16960)
    753d0c0

    @terryjreedy
    Copy link
    Member

    New changeset 592527f by Zackery Spytz in branch 'master':
    bpo-4630: Fix errors in Lib/idlelib/NEWS.txt (GH-21594)
    592527f

    @miss-islington
    Copy link
    Contributor

    New changeset 4cf7afc by Miss Islington (bot) in branch '3.9':
    bpo-4630: Fix errors in Lib/idlelib/NEWS.txt (GH-21594)
    4cf7afc

    @terryjreedy
    Copy link
    Member

    New changeset 29df301 by Terry Jan Reedy in branch '3.8':
    [3.8] bpo-4630: Fix errors in Lib/idlelib/NEWS.txt (GH-21594)
    29df301

    @terryjreedy terryjreedy added the 3.10 only security fixes label Jul 23, 2020
    @terryjreedy terryjreedy removed the 3.7 (EOL) end of life label Jul 23, 2020
    @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.10 only security fixes topic-IDLE type-feature A feature request or enhancement
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants