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 Classic Unix keyboard shortcuts broken #87406

Closed
alandmoore mannequin opened this issue Feb 16, 2021 · 6 comments
Closed

IDLE Classic Unix keyboard shortcuts broken #87406

alandmoore mannequin opened this issue Feb 16, 2021 · 6 comments
Assignees
Labels
3.9 only security fixes topic-IDLE type-bug An unexpected behavior, bug, or error

Comments

@alandmoore
Copy link
Mannequin

alandmoore mannequin commented Feb 16, 2021

BPO 43240
Nosy @terryjreedy, @serhiy-storchaka, @alandmoore

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 2021-02-17.04:18:52.964>
created_at = <Date 2021-02-16.18:37:48.968>
labels = ['expert-IDLE', 'type-bug', '3.9']
title = 'IDLE Classic Unix keyboard shortcuts broken'
updated_at = <Date 2021-02-17.20:15:42.546>
user = 'https://github.com/alandmoore'

bugs.python.org fields:

activity = <Date 2021-02-17.20:15:42.546>
actor = 'Alan Moore'
assignee = 'terry.reedy'
closed = True
closed_date = <Date 2021-02-17.04:18:52.964>
closer = 'terry.reedy'
components = ['IDLE']
creation = <Date 2021-02-16.18:37:48.968>
creator = 'Alan Moore'
dependencies = []
files = []
hgrepos = []
issue_num = 43240
keywords = []
message_count = 6.0
messages = ['387124', '387127', '387135', '387168', '387170', '387188']
nosy_count = 3.0
nosy_names = ['terry.reedy', 'serhiy.storchaka', 'Alan Moore']
pr_nums = []
priority = 'normal'
resolution = 'third party'
stage = 'resolved'
status = 'closed'
superseder = None
type = 'behavior'
url = 'https://bugs.python.org/issue43240'
versions = ['Python 3.9']

@alandmoore
Copy link
Mannequin Author

alandmoore mannequin commented Feb 16, 2021

Using IDLE 3.9.1 on Arch Linux.

In IDLE I've selected the "classic unix" key set. It worked for a while, then stopped registering key combinations for more than one key (e.g. Ctrl-x Ctrl-s).

Have tried creating a custom key set and manually setting the shortcuts, but it still fails the same way. Caps lock is not on (disabled on my system).

Have also tried moving configs and starting fresh, does not help.

It had been working, then suddenly stopped in the middle of a work day and I can't get it working again.

@alandmoore alandmoore mannequin added the 3.9 only security fixes label Feb 16, 2021
@alandmoore alandmoore mannequin assigned terryjreedy Feb 16, 2021
@alandmoore alandmoore mannequin added topic-IDLE type-bug An unexpected behavior, bug, or error 3.9 only security fixes labels Feb 16, 2021
@alandmoore alandmoore mannequin assigned terryjreedy Feb 16, 2021
@alandmoore alandmoore mannequin added topic-IDLE type-bug An unexpected behavior, bug, or error labels Feb 16, 2021
@alandmoore
Copy link
Mannequin Author

alandmoore mannequin commented Feb 16, 2021

OK, it seems that closing all my firefox windows restored correct behavior to IDLE. I can only guess that somehow firefox was eating the Ctrl-x.

Not sure if this is a firefox issue, a window manager issue, or an IDLE issue. If you think it's not the latter, feel free to close.

@terryjreedy
Copy link
Member

IDLE just tells tcl/tk via tkinter what function to call when particular UI events happen. Recognizing UI events is handled between the OS window manager and tcl/tk. So I am sure this is not an IDLE issue.

For another application to affect the Linux-tcl interaction is new to me. Serhiy, have you ever heard of such a thing, or seen it happen?

@alandmoore
Copy link
Mannequin Author

alandmoore mannequin commented Feb 17, 2021

An interesting note this morning, and again I don't know if this is actually an IDLE bug; I had left IDLE running overnight and opened a new code window this morning. Somehow IDLE "forgot" that Ctrl-N means "next line" and not "new window". I closed all my firefox windows, then went into IDLE settings, changed the key set to something else and back to Classic Unix, now it works correctly again.

Firefox has been known to steal my keyboard input from time to time when not focused, though it's usually all-or-nothing. I don't know if it's the culprit or if I'm just blaming it due to past prejudice, but it seems to set things right in IDLE faster if I close all firefox windows.

In any case, I don't know if this could be an IDLE bug or not, just thought I'd share.

@alandmoore
Copy link
Mannequin Author

alandmoore mannequin commented Feb 17, 2021

Ok, sorry to keep poking at this issue, but I think I was too hasty in blaming firefox.

As I previously mentioned, IDLE "forgot" that Ctrl-N meant "next line" and reverted it to "new window". I fixed that behavior by changing and resetting the key set, HOWEVER, now the multiple-key sequences like Ctrl-X-Ctrl-S are broken again. Closing all other programs, rebooting the system, defaulting my IDLE configuration -- none of that makes a difference. Truly I'm baffled.

Is there actually code in IDLE/Tkinter to handle those kind of keyboard shortcuts, or is that a Tcl/Tk feature that is merely exposed by the Python side? If the former, could someone point me in the direction of said code?

@alandmoore
Copy link
Mannequin Author

alandmoore mannequin commented Feb 17, 2021

Spent some time today with IDLE and PDB, and I've ruled out any other program on my system as the culprit:

  • I can create a tkinter GUI that will respond to a binding like <Control-Key-x><Control-Key-s> and it works fine.
  • In pdb, I can bind <<do-nothing>> to a callback and it is getting fired when Ctrl-x is pressed. Thus, I was wrong to think anything else is "eating" the ctrl-x.
  • Also in pdb, an .event_info('<<save-window>>') call on the editor's Text widget returns ('<Control-Key-x><Control-Key-s>',), so it looks bound correctly? If I generate a <<save-window>> event, the dialog pops up as it should.

Nevertheless, Ctrl-x Ctrl-s opens the find dialog, and no other Ctrl-x (other keystroke) binding works. I'm stumped.

@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.9 only security fixes topic-IDLE type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

1 participant