zellij icon indicating copy to clipboard operation
zellij copied to clipboard

Support xterm focus reporting

Open zolrath opened this issue 1 year ago • 4 comments

Hey hey, still loving zellij, great work on the newest update!

Issue

xterm compatible consoles emits FocusIn/FocusOut event sequences which are used by various CLI apps, but these events are swallowed up by zellij.

For example, in my vim settings I sync with the system clipboard only when the terminal gains/loses focus to speed up pasting dramatically:  

-- sync with system clipboard on focus
vim.api.nvim_create_autocmd({ "FocusGained" }, {
  pattern = { "*" },
  command = [[call setreg("@", getreg("+"))]],
})

-- sync with system clipboard on focus
vim.api.nvim_create_autocmd({ "FocusLost" }, {
  pattern = { "*" },
  command = [[call setreg("+", getreg("@"))]],
})

When using my terminal (in this case WSL Ubuntu in WezTerm on Windows) normally clipboard syncing works as expected without zellij.

Request

I'd love for zellij to both emit these events:

  1. When the terminal itself gains/loses focus.
  2. When the current pane loses focus via changing tabs or panes.

Thanks again!

zolrath avatar Apr 18 '24 21:04 zolrath

So, Zellij does support these and emits them when focus is changed between panes but I now checked and indeed it does not when focus is gained/lost from the current terminal window. Would be a good addition!

imsnif avatar Apr 19 '24 07:04 imsnif