tmux-xpanes icon indicating copy to clipboard operation
tmux-xpanes copied to clipboard

Idea: Alias feature

Open greymd opened this issue 5 years ago • 2 comments

Here is my rough idea. New feature called alias feature. Any feedbacks is welcome.

For now, xpanes has following problems.

  • Users cannot set pane's title provided by -t individualy.
  • Re-define xpanes with built-in alias is lazy.
    • Many escaping
    • i.e: alias prod-servers="xpanes -c 'ssh {}' \"-i key1 user1@server1\" \"-i key2 user2@server2\" "

Alias feature would solve above problems.

Creating file. It would be TSV, YAML or JSON. ${HOME}/.config/tmux-xpanes/aliases/prod-servers.yaml

- cmd: ssh server1
  title: server1
- cmd: ssh server2
  title: server2
- cmd: ssh server3
  title: server3
- cmd: ssh server4
  title: server4

Execute with --alias, -A + Alias name

xpanes -A prod-servers

Result

    +-------------------------------+------------------------------+
    │$ ssh server1                  │$ ssh server2                 │
    │                               │                              │
    │                               │                              │
    │                               │                              │
    │                               │                              │
    │                               │                              │
    │                               │                              │
    │                               │                              │
    +-[server1]---------------------+-[server2]--------------------+
    │$ ssh server3                  │$ ssh server4                 │
    │                               │                              │
    │                               │                              │
    │                               │                              │
    │                               │                              │
    │                               │                              │
    │                               │                              │
    │                               │                              │
    +-[server3]---------------------+-[server4]--------------------+

greymd avatar Nov 20 '18 22:11 greymd

hi,

I will try it out. I tested it a while ago with bash alias ... with that kind of stuff .. but using a yaml file looks great, because we can push them into a Git repo.

linuxmail avatar Nov 27 '18 14:11 linuxmail

did this ever get pushed out? it would totally solve my escape nightmare of aliases right now lol

kurktchiev avatar Dec 05 '20 10:12 kurktchiev