Closed xxxserxxx closed 4 years ago
@alexherbo2 focus is way better than i3-msg. What about:
focus
doesn't helpAren't you concerned about backwards compatability here? People who pull this are going to be in for a surprise when the behavior suddenly changes.
I don’t care about backward compatibility, but if it bothers users, I will change it or add an option.
I use connect mostly with
nnn
as a sort of project manager. More often than not, after opening a file innnn
, I want focus to return to kakoune. This patch adds that ability.When the option
connect_focus
is set,edit
will focus the window containing kakoune. This works reliably with i3, because both kakoune and i3 provide good information and mechanisms for making it happen. It works with tmux if the user doesn't move panes around; this limitation is due to the fact that there's no way to focus a pane by name, and wouldn't even if it could because kakoune doesn't set a pane title. However, the default behavior -- of opening a tmux pane to the right -- is assumed and control is return to the pane to the left. There is no functionality for any other window manager.The script tries to do the right thing: it only does its thing if the
connect_focus
option is set; then it tries to detect if it is running in tmux, and if so, tries to return focus that way; then if not, it tries to do it with i3.Example use:
select a file in.
nnn
and hit