zellij-org / zellij

A terminal workspace with batteries included
https://zellij.dev
MIT License
20.69k stars 640 forks source link

Support various `Action` commands for server-client communication #1263

Open jaeheonji opened 2 years ago

jaeheonji commented 2 years ago

Overview

Tmux supports a wide range of Action Commands. And this can be classified into three main parts.

Each category has the following detailed command or purpose. (The comparison was focused on the purpose rather than the details.)

Clients and Sessions

Purpose Tmux Zellij Status
attach target session attach-session attach Done
list all sessions list-sessions list-sessions Done
destroy target session kill-session kill-session and kill-all-sessions Done
rename target session rename-session #998 In progress
lock target session lock-session #1265 Done
detach target client detach-client #1265 Done
switch target client switch-client None #8841

There is also a start-server command in tmux, but in zellij, it can be executed through --server options. and it is also related to #1062

Key bindings

Purpose Tmux Zellij Status
send a key or keys to a window(tab) send-keys Done #1265
send a text or buffers to a window(tab) send-keys2 Done #809, #1265

tmux also has send-prefix, but this doesn't seem necessary for zellij.

If there is anything to be added or not necessary, please let me know 😃

EDIT: Most of the features are currently implemented, but I'll keep this issue for issue tracking.


1. It seems to be a partially implementable issue for switch-client. 2. In the case of tmux, one command covers both key and text.

auronandace commented 2 years ago

In case you are looking to update this issue:

For switching sessions there is #884 One feature I'd like to see is #809

jaeheonji commented 2 years ago

@auronandace Thank you! I updated it 👍

a-kenji commented 2 years ago

We can also send keys with #1265 through Write: [], here is an example that sends ^b.

uncomfyhalomacro commented 2 years ago

In case you are looking to update this issue:

For switching sessions there is #884 One feature I'd like to see is #809

Hello. Personal life has suddenly become too hectic for me so I put my Rust learning aside for quite a few months. Fortunately, a few weeks ago, I have free time now to review Rust and been started doing small projects with it. I will take a look again to #809 :smile:

wcasanova commented 2 years ago

bind C-a send-prefix how can I replicate this in zellij Bind C-a to send-prefix, so that C-a C-a sends a C-a to the application inside tmux/zellij this is useful when you have a remote computer with zellij as well.

jaeheonji commented 2 years ago

@wcasanova

Hi!, Maybe I'm not understanding it well, but this seems to have something to do with keybindings. Zellij has a tmux mode using C-b. You can change the settings related to this. Check out default.yaml. If it is something else, it would be helpful if you create a new issue.

wcasanova commented 2 years ago

Yes I have changed from C-b to C-a, but this is not the problem, it is when you have in your machine a zellij, and you have another remote machine inside the Zellij with another Zellij, I don't know if I understand. The issue is to be able to send the key combination to the second Zellij, I do this with tmux.

a-kenji commented 2 years ago

@wcasanova, In the default configuration you can send the prefix key through ^b-^b, since you changed your configuration, you will also need to adjust sending the prefix again, because you changed the prefix, but not the sending of the prefix.

Under the tmux mode you can see:

        - action: [Write: [2,], SwitchToMode: Normal]
          key: [Ctrl: 'b']

You can choose to adjust this to your preference, for example if you want to send 1 (^a), you will just have to adjust this value like so:

        - action: [Write: [1,], SwitchToMode: Normal]
          key: [Ctrl: 'a']

You can see the default configuration, when running zellij setup --dump-config

a-kenji commented 2 years ago

@jaeheonji,

tmux also has send-prefix, but this doesn't seem necessary for zellij

It isn't necessary because we also have it, just we need to specify it directly. Since we can have an unlimited numbers of prefixes.