Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add newline list format flag #678

Closed
raiyuza opened this issue Jan 31, 2019 · 0 comments
Closed

Add newline list format flag #678

raiyuza opened this issue Jan 31, 2019 · 0 comments

Comments

@raiyuza
Copy link
Contributor

raiyuza commented Jan 31, 2019

Is your feature request related to a problem? Please describe.
I use a custom build tmux which extends tmux configuration with a subset of the tcl language.

I tried to get the project names from the list command but due an poor implementation of tcl or lack of understanding. I could only only get so so far without using quotes. The furthest i got was something like the following.

#choose from list and switch to project
bind-key P tcl {
  cd [f #{pane_current_path}]

  choose-from-list {*}[split [exec tmuxinator list | tail +2 | grep -oE {([0-9]|[aa-zz])\w+} | sort  ] "\n"] -onselect {
    exec git checkout [lindex [split [string range $_ 2 end] " "] 0]
}

All this work just to print the project names line by line, and even then i had to make additional iterations to get all the matches.

This made me wonder why can't we do something like ls -1 for the list command.

Describe the solution you'd like
I suggest creating a flag called '--newline' to print each line like such :

$> tmuxinator list --newline
barfoo
foobar
yxz

This will make it easier and i assume more compatible with other text processing commands

Describe alternatives you've considered

bind-key P tcl {
  cd [f #{pane_current_path}]

  choose-from-list {*}[split [exec sh findprojectslist.sh | sort  ] "\n"] -onselect {
    exec git checkout [lindex [split [string range $_ 2 end] " "] 0]
}

Writing my own PRQ

Additional context
This is my first issue ever created on github, any feedback is welcome!

raiyuza added a commit to raiyuza/tmuxinator that referenced this issue Jan 31, 2019
I created a --newline flag for the ``list`` command. Read up on issue
 tmuxinator#678 [here](tmuxinator#678)

```bash
-n, [--newline], [--no-newline]  # Force output to be one entry per line
```

Small sidenote:
  this is my first public MRQ and ruby contribution, any feedback is wel
  come
raiyuza pushed a commit to raiyuza/tmuxinator that referenced this issue Jan 31, 2019
Add support list --newline (tmuxinator#678)

See merge request tverdonck/tmuxinator!1
raiyuza added a commit to raiyuza/tmuxinator that referenced this issue Jan 31, 2019
I created a --newline flag for the ``list`` command. Read up on issue
 tmuxinator#678 [here](tmuxinator#678)

```bash
-n, [--newline], [--no-newline]  # Force output to be one entry per line
```

Small sidenote:
this is my first public MRQ and ruby contribution, any feedback is
welcome
raiyuza added a commit to raiyuza/tmuxinator that referenced this issue Jan 31, 2019
I created a --newline flag for the ``list`` command. Read up on issue
 tmuxinator#678 [here](tmuxinator#678)

```bash
-n, [--newline], [--no-newline]  # Force output to be one entry per line
```

Small sidenote:
  this is my first public MRQ and ruby contribution, any feedback is wel
  come
raiyuza added a commit to raiyuza/tmuxinator that referenced this issue Jan 31, 2019
I created a --newline flag for the ``list`` command. Read up on issue
 tmuxinator#678 [here](tmuxinator#678)

```bash
-n, [--newline], [--no-newline]  # Force output to be one entry per line
```

Small sidenote:
  this is my first public MRQ and ruby contribution, any feedback is wel
  come
raiyuza added a commit to raiyuza/tmuxinator that referenced this issue Feb 1, 2019
I created a --newline flag for the ``list`` command. Read up on issue
 tmuxinator#678 [here](tmuxinator#678)

```bash
-n, [--newline], [--no-newline]  # Force output to be one entry per line
```

Small sidenote:
  this is my first public MRQ and ruby contribution, any feedback is wel
  come
raiyuza added a commit to raiyuza/tmuxinator that referenced this issue Feb 1, 2019
I created a --newline flag for the ``list`` command. Read up on issue
 tmuxinator#678 [here](tmuxinator#678)

```bash
-n, [--newline], [--no-newline]  # Force output to be one entry per line
```

Small sidenote:
  this is my first public MRQ and ruby contribution, any feedback is wel
  come
raiyuza added a commit to raiyuza/tmuxinator that referenced this issue Feb 1, 2019
I created a --newline flag for the ``list`` command. Read up on issue
 tmuxinator#678 [here](tmuxinator#678)

```bash
-n, [--newline], [--no-newline]  # Force output to be one entry per line
```

Small sidenote:
  this is my first public MRQ and ruby contribution, any feedback is wel
  come
raiyuza added a commit to raiyuza/tmuxinator that referenced this issue Feb 1, 2019
I created a --newline flag for the ``list`` command. Read up on issue
 tmuxinator#678 [here](tmuxinator#678)

```bash
-n, [--newline], [--no-newline]  # Force output to be one entry per line
```

Small sidenote:
  this is my first public MRQ and ruby contribution, any feedback is wel
  come
ethagnawl pushed a commit to ethagnawl/tmuxinator that referenced this issue May 22, 2019
* Add support list --newline (closes tmuxinator#678)

I created a --newline flag for the ``list`` command. Read up on issue
 tmuxinator#678 [here](tmuxinator#678)

```bash
-n, [--newline], [--no-newline]  # Force output to be one entry per line
```

Small sidenote:
  this is my first public MRQ and ruby contribution, any feedback is wel
  come

* Update cli.rb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant