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

"Notify only in background" does not work #2563

Closed
faerot opened this issue Dec 13, 2024 · 8 comments
Closed

"Notify only in background" does not work #2563

faerot opened this issue Dec 13, 2024 · 8 comments

Comments

@faerot
Copy link
Contributor

faerot commented Dec 13, 2024

I have pulled latest version and just build far2l and it annoyingly shows notifications about every run command even when I am running it directly, without minimizing far2l. "Notify only in background" seems to have no effect, only when I disable notifications completely, they go away.

@unxed
Copy link
Contributor

unxed commented Dec 14, 2024

The reason is probably that far2l in tty mode does not know the state of focus on terminal window.
Possible solution is to track it using \033[?1004l mode. Focus tracking should have 3 states:

  • we have focus
  • we do not have focus
  • focus state is unknown (some terminals do not support reporting current state)

Notifications should be sended only if we definitely do not have focus.

@unxed
Copy link
Contributor

unxed commented Dec 14, 2024

@Dazzar56 could you please help with adding this?

@spnethw
Copy link
Contributor

spnethw commented Dec 14, 2024

At the moment there is just a stub here:

bool TTYBackend::OnConsoleIsActive()
{
return false;//true;
}

@elfmz
Copy link
Owner

elfmz commented Dec 14, 2024

may change to return _far2l_tty ? false : true; as quick workaround

@elfmz
Copy link
Owner

elfmz commented Dec 14, 2024

..or better: #2567

elfmz added a commit that referenced this issue Dec 14, 2024
TTY/VT: focus change notifications  (touch #2563)
@elfmz
Copy link
Owner

elfmz commented Dec 14, 2024

check current master please if you can

@unxed
Copy link
Contributor

unxed commented Dec 14, 2024

Works for me :)

@spnethw
Copy link
Contributor

spnethw commented Dec 14, 2024

Works as expected in: Konsole, Gnome Terminal, kovidgoyal's kitty.

@elfmz elfmz closed this as completed Dec 14, 2024
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

No branches or pull requests

4 participants