Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

There's no visibile difference between two focused/unfocused clients in Tmux panes #3942

Closed
lenormf opened this issue Dec 14, 2020 · 7 comments

Comments

@lenormf
Copy link
Contributor

lenormf commented Dec 14, 2020

Feature

A client that lacks focus in a Tmux pane shows no indication of that.

HTH.

@Screwtapello
Copy link
Contributor

I feel like it's more tmux's job to show which pane is focussed, rather than Kakoune's job.

@lenormf
Copy link
Contributor Author

lenormf commented Dec 15, 2020

The issue is that clients show no indication that they are not accepting input, irrespective of what window manager they're in. If anything can be done to make a step towards that, I'll take it, I don't know what though (a modeline token?).

Several users have mentioned some kind of visual effect on the main cursor, but I don't think that's appropriate.

Alternatively we could come up with a snippet that implements that for given window managers and document it in the wiki, if that hasn't been done already. If there's no need for a core feature to implement that, I'll close this issue, just want to leave no doors un-opened.

@vbauerster
Copy link
Contributor

vbauerster commented Dec 19, 2020

I have following snippet in my config, which toggles status line background. It works most of the time, but has some edge cases which I don't remember right now.

hook global FocusIn .* %{
    unset-face window StatusLine
    evaluate-commands %sh{
        base00="rgb:FDFDFD"
        base03="rgb:8e908c"
        for client in $kak_client_list; do
            if [ "$client" != "$kak_hook_param" ]; then
                printf 'eval -no-hooks -client %s %%{face window StatusLine %s,%s}\n' \
                "$client" "$base00" "$base03"
            fi
        done
    }
}

hook global WinDisplay .* %{
    unset-face window StatusLine
}

Screenshot-2020-12-20-at-00-38-47.png

Updated script is on wiki.

@toddyamakawa
Copy link

tmux can definitely handle this.

tmux set-option -g active-border-style "formathere"
tmux set-window-option -g pane-border-format "formatgoeshere"

@krobelus
Copy link
Contributor

For the lazy, here's an example ~/.tmux.conf with green borders:

set -g pane-border-style			"fg=colour238 bg=default"
set -g pane-active-border-style 		"fg=green bg=default"

@mawww
Copy link
Owner

mawww commented Dec 23, 2020

I dont think thats something we can reliably fix in Kakoune, a client always accept inputs, its up to the terminal emulator to send it or not. The FocusIn/FocusOut events can help make an educated guess, but there no guarantee that they will be emitted by the terminal emulator nor that there will be a single focused client as we can have clients running in many different terminals at the same time (some from ssh, some in tmux, some in wayland, some through X11...).

Having a hook based best-effort solution seems like the best bet, as it does not then need to be correct, it just need to work well enough for the users workflow.

@lenormf
Copy link
Contributor Author

lenormf commented Dec 23, 2020

That's fine, case closed!

@lenormf lenormf closed this as completed Dec 23, 2020
# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

6 participants