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

Disable terminal focus reporting #2964

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

krobelus
Copy link

@krobelus krobelus commented Apr 6, 2024

Terminals can be asked to report focus events with

    print("\x1b[?1004h")

For some reason, our use of curses sends a sequence like that (not
exactly that one, but it contains "1004", you can observe it by
running ranger inside "script").

Then the terminal will send ^[[I and ^[[O for "focus in" and "focus
out" events respectively. This is quite annoying. The proper way
to deal with these is to map them ourselves in all modes (to a nop,
or optionally add some UI feedback).

I do not know how to do that, so turn it off altogether with the
corresponding "l" sequence.

Fixes #2864

Terminals can be asked to report focus events with

        print("\x1b[?1004h")

For some reason, our use of curses sends a sequence like that (not
exactly that one, but it contains "1004", you can observe it by
running ranger inside "script").

Then the terminal will send ^[[I and ^[[O for "focus in" and "focus
out" events respectively.  This is quite annoying. The proper way
to deal with these is to map them ourselves in all modes (to a nop,
or optionally add some UI feedback).

I do not know how to do that, so turn it off altogether with the
corresponding "l" sequence.

Fixes ranger#2864
Copy link

@abrac abrac left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All good. Can't see any issues that could arise from this fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Receiving Keyboard signals when switching focus in window managers
2 participants