Giter Club home page Giter Club logo

tmux-xpanes's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

tmux-xpanes's Issues

Argument which only has empty string or line break causes broken layout.

$ tmux -V; xpanes -V
tmux 2.4
xpanes 2.0.2

This command causes broken layout sometimes.

$ xpanes '' 2 '\n' 3

Like this

screen shot 2017-05-14 at 6 29 26 pm

dump

...
+ tmux -S /root/.cache/xpanes/socket send-keys -t xpanes-11535:tmp-11535 '/usr/bin/xpanes '\''-c'\'' '\''echo {} '\''  '\''--'\'' '\'''\'' '\''2'\'' '\''\n'\'' '\''3'\'' ' C-m
+ tmux -S /root/.cache/xpanes/socket send-keys -t xpanes-11535:tmp-11535 exit C-m
+ '[' 1 -eq 1 ']'
+ tmux -S /root/.cache/xpanes/socket attach-session -t xpanes-11535
[exited]
+ '[' 0 -ne 0 ']'
+ xpns_restore_allow_rename on /root/.cache/xpanes/socket
+ local _default_allow_rename=on
+ local _session=/root/.cache/xpanes/socket
+ [[ on == \o\n ]]
+ '[' -z /root/.cache/xpanes/socket ']'
+ tmux -S /root/.cache/xpanes/socket set-window-option -g allow-rename on
no server running on /root/.cache/xpanes/socket
+ exit 0

Set pane ssh title

Hi,

since I can't use mssh anymore, I learned to love tmux, because of xpanes :-) The only thing I miss under my Linux (bash), is to know, which pane is which (ssh) host. If I connect to 20 hosts or more, I have only the hostname, which you don't see always.
Is there a way to put a small bar under every pane which shows the hostname ?

cu denny

Support `--` argument.

In general, all the arguments after the -- are recognized as the arguments (not option).
For example.

$ xpanes -- -a -b -d -l

Expected result is

$ echo -a                      │$ echo -b 
                               │
                               │
                               │
                               │
                               │
                               │
                               │
───────────────────────────────┼───────────────────────────────
$ echo -d                      │$ echo -l 
                               │
                               │
                               │
                               │
                               │
                               │
                               │

[2.0.0] Cool logo and introduction image

I want like...

$ figlet -f avatar xpanes
___  _ ____  ____  _      _____ ____
\  \///  __\/  _ \/ \  /|/  __// ___\
 \  / |  \/|| / \|| |\ |||  \  |    \
 /  \ |  __/| |-||| | \|||  /_ \___ |
/__/\\\_/   \_/ \|\_/  \|\____\\____/

Improve algorithm for splitting a window

When the large number of arguments are given, the split time is very slow.
There must be better algorithm.
Currently, xpanes executes select-layout tiled and re-organize the panes for every splitting action.
https://github.com/greymd/tmux-xpanes/blob/master/bin/xpanes#L402

However, the minimum size of the pane is defined by tmux.
Defined in : https://github.com/tmux/tmux/blob/74ecc866cf7613a3af10f400b4d59c12200d38c5/tmux.h#L68
Referd in : https://github.com/tmux/tmux/blob/102df8dc8047d992e2fe72a2aa3d2f7eee3d185a/layout.c#L833

My idea is...

  • Suppressing re-organization of panes until the pane reaches minimum width or height.
  • The window is separated vertically or horizontally (longer side should be separated to avoid reaching the minimum length).

pipe mode + --ssh option

$ echo AAA BBB | xargs -n 1 | ./xpanes --ssh

result is

  • pane1
ssh -o StrictHostKeyChecking=no AAA  AAA
  • pane2
ssh -o StrictHostKeyChecking=no BBB BBB

Feature to append new panes to existing window.

I want the feature like this. -a means append.
Or, -x (extend) may also be meaningful.

    +-------------------------------+-------------------------------+
    │$                              │$                              │
    │                               │                               │
    │                               │                               │
    │                               │                               │
    │                               │                               │
    │                               │                               │
    │                               │                               │
    │                               │                               │
    +-------------------------------+-------------------------------+
    │ $ xpanes -a 4 5 6                                             │
    │                                                               │
    │                                                               │
    │                                                               │
    │                                                               │
    │                                                               │
    │                                                               │
    │                                                               │
    +-------------------------------+-------------------------------+

Result:

    +-------------------------------+-------------------------------+
    │$                              │$                              │
    │                               │                               │
    │                               │                               │
    │                               │                               │
    │                               │                               │
    │                               │                               │
    +-------------------------------+-------------------------------+
    │$                              │$ echo 4                       │
    │                               │                               │
    │                               │                               │
    │                               │                               │
    │                               │                               │
    │                               │                               │
    +-------------------------------+-------------------------------+
    │$ echo 5                       │$ echo 6                       │
    │                               │                               │
    │                               │                               │
    │                               │                               │
    │                               │                               │
    │                               │                               │
    +-------------------------------+-------------------------------+

Refactoring for 2.0.1

  • There is some unused variables.
  • "xpns_enable_long_options" -> "xpns_load_long_options"

Support non-bash-compatible default shell

I use fish shell, and xpanes does not work because it tries to run this command in my default shell (fish)

~
$ /usr/bin/xpanes '-c' 'echo {}'  '--' '11' '12'  && exit
Unsupported use of '&&'. In fish, please use 'COMMAND; and COMMAND'.
fish: /usr/bin/xpanes '-c' 'echo {}'  '--' '11' '12'  && exit

It doesn't work even if I open bash and run xpanes in it.

Could you add support for trying to open bash if it's not default shell but is available on the system?

Implement `-n` option for pipe mode.

Improve the way for separating standard input strings.
Introducing same tokenization logic as xargs, we can implement -n option as same as xargs like this.

$ command  | xpanes -n 2 -I@ seq @

Tilde expansion does not work correctly.

$ bash --version
GNU bash, version 4.2.46(2)-release (x86_64-redhat-linux-gnu)
Copyright (C) 2011 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>

This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

$ tmux -V
tmux 1.8

$ xpanes -V
xpanes 2.2.0

$ cout-login --log=~/logs host{1..3}
/home/user/.cache/cout-login/bin/xpanes: line 985: cd: ~/logs: No such file or directory
set option: allow-rename -> off
[exited]
failed to connect to server

And ~/logs directory was not created.

warn message for old version of tmux

$ tmux -V
1.5

$ xpanes 1 2 3
warn: xpanes may not work currectly because current tmux version is 'tmux 1.5'.
tmux 1.6 and more upper versions are officially supported.

Why default to synchronize?

If I run xpanes {1..4} all for window panes/splits are synchronize. With this, when I do ls for example, all panes do the same thing, giving the same output. Why would this be better default than turning synchronization of by default? I can make changes to the way I want, but just want to understand the rationale first.

Adding a RPM SPEC file

Hi Yasuhiro,

Thanks for this excellent tmux utility!

I created a "basic" RPM SPEC file to package this for RHEL based systems. I'm using CentOS 7 and it works very well with the distribution included tmux (v1.8).

The generated RPM install the following file tree:

/
|-- usr
|    |-- bin
|    |   |-- tmux-xpanes -> ./xpanes
|    |   `-- xpanes
|    `-- share
|        |-- doc
|        |   `-- tmux-xpanes-2.2.1
|        |       |-- CONTRIBUTING.md
|        |       `-- README.md
|        |-- licenses
|        |   `-- tmux-xpanes-2.2.1
|        |       `-- LICENSE
|        `-- man
|            `-- man1
|                |-- tmux-xpanes.1.gz -> xpanes.1.gz
|                `-- xpanes.1.gz
...

If you think this can be useful to others, I can make a pull request or you can copy it directly from my fork: https://github.com/mpatenaude/tmux-xpanes/blob/master/tmux-xpanes.spec

Best,
Math

[2.0.0] Execute mode `-e`

-e option is same as -c '{}'

normal mode

$ xpanes -e "top" "vmstat 1"

result

$ top  | $ vmstat 1
       | 
       | 

xargs mode

$ echo -e "top\nvmstat 1" | xpanes -e

result(same)

$ top  | $ vmstat 1
       | 
       | 

Make "tmux" command customizable.

tmux-xpanes internally uses tmux command as the default executor of the tmux.
However, I imagine that someone wants to use tmux -2 as the default command, or someone may want to use tmux command on the non-general directory, like ~/bin/tmux.

My idea is...

  • Define environment variable TMUX_XPANES_EXEC.
  • xpanes uses the environment variable as the command. If it's empty, tmux is just used.
$ export TMUX_XPANES_EXEC="~/bin/tmux -2"
$ xpanes 1 2 3 4
# => Then, "~/bin/tmux -2" will internally be used.

Meta characters in window name.

If the argument has special characters like dot ., default window name will be escaped one.
for example,

$ xpanes 3.14 

Window name will be 3\x2e14.
\x2e corresponding to dot .. This is the specification because if the window name has some special characters like ., -, window separation feature given by tmux does not work. But I would like to fix this issue.

[2.0.0] documentation

  • add description of pipe mode to readme.
  • update wiki
    • support ubuntu version.
    • deb, homebrew package has dependency with tmux

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.