zellij icon indicating copy to clipboard operation
zellij copied to clipboard

missing feature: passthrough?

Open colemickens opened this issue 4 years ago • 14 comments

What happens when I run zellij on my host, and zellij on my remote machine, thus rendering two sets of frames? How do I pass through keystrokes to another instance.

This already sort of works with only-two sessions, because you can lock the top layer and trigger the inner second layer, but obviously this doesn't work for everything, doesn't generalize past two layers, etc.

It seems that, as tmux offers, there needs to be a way to say "the next keystroke specifically goes to the focused pane".

colemickens avatar Oct 11 '21 04:10 colemickens

So, this is actually a big problem in my personal workflow. When I develop Zellij, I am forced to open my "development" copy in a different terminal window because of this. So I feel strongly about solving it :)

I like the idea of having a shortcut that would say "the next keystroke specifically goes to the focused pane" as you suggest. I kind of feel though that we might be able to make this an additional "escape hatch" to an otherwise more intuitive out-of-the-box workflow.

Here's my suggestion: When we have nested Zellij sessions, the commands will always go to the deepest session, unless:

  1. If the deepest session is locked, it will go one layer up
  2. If all sessions are locked and the user presses ctrl-g it will unlock all sessions

What do you think?

imsnif avatar Oct 11 '21 10:10 imsnif

@imsnif Is zellij able to do two-way communication between nested sessions in a generic way? If so a ctrl-$ N would be an option as well, where $ is some key we didn't decide on yet and N is the depth you want to execute upcoming commands at.

This way you can easily jump back and forth between levels, which is useful when sshing through jumpboxes/bastions.

Lillecarl avatar Nov 22 '21 18:11 Lillecarl

@Lillecarl - if I'm being honest this sounds a bit complex both to implement and to use... do you find yourself very often with more than 2-3 nested Zellij sessions?

imsnif avatar Nov 23 '21 09:11 imsnif

@imsnif 3 isn't entirely uncommon, one on my host, one on a bastion, one on the server i'd like to remote.

An action to unlock all the way down rather than having to cycle through locks could probably work nice too. But relying on pressing something multiple times in a sequence will 100% lead to people "overshooting" the lock status quite a bit. So that might be a good middle ground.

Though if the framework of bidi communication is in place that could find a lot of other cool usecases in the future (But beyind the scope of this issue).

I think I've nested 4x at most. usually the panes are fullscreen then and I mostly use Zellij/tmux to not lose state.

Lillecarl avatar Nov 23 '21 09:11 Lillecarl

I think that is a solution that would fit well I think. It could be bound to the session-mode. And for example Up/Down - J/K - Could be session up / session down. And the numbers could be the nesting sessions themselves.

a-kenji avatar Nov 23 '21 09:11 a-kenji

Ah, that's a pretty cool idea @a-kenji !! Like in SESSION mode, assuming the session is nested you'd be able to walk through the sessions... Meaning that all sessions except the focused one are locked. Right?

imsnif avatar Nov 23 '21 09:11 imsnif

@imsnif, Yes, that would make sense for me.

a-kenji avatar Nov 23 '21 10:11 a-kenji

Could all workflows with nested session also be achieved by having a single zellij client connect to multiple (local and remote) servers and their sessions? See also https://github.com/zellij-org/zellij/issues/387

If so, this seems more elegantly and ergonomically from a user perspective.

raphCode avatar Dec 14 '21 17:12 raphCode

I have zellij -> ssh -> tmux for sharing terminal sessions on a server with our dev team

so I think there needs to be a general solution, not just for zellij -> zellij

markus-wa avatar May 18 '22 13:05 markus-wa

@markus-wa just lock zellij with ctrl+g

Lillecarl avatar May 18 '22 14:05 Lillecarl

:exploding_head: I was just frantically searching for "zellij escape key" for one hour now

yet it was always right in front of me ... :sweat_smile:

thanks, that solves it for me! :smile:

markus-wa avatar May 18 '22 14:05 markus-wa

looking forward to see passthrough for base16-shell possible to work with zellij like tmux does.

ryuheechul avatar Jan 14 '23 06:01 ryuheechul