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

Should the session list be case insensitive #2

Open
vendion opened this issue Sep 12, 2014 · 4 comments
Open

Should the session list be case insensitive #2

vendion opened this issue Sep 12, 2014 · 4 comments

Comments

@vendion
Copy link

vendion commented Sep 12, 2014

When opening the session list <prefix> + g some of my tmux sessions are in mix case or all uppercase. I think the tmux-sessionist plugin's search should be case insensitive, maybe give a filtered output if more than one session matches the search string, or display a message that exact matching is not possible with the search string?.

@bruno-
Copy link
Member

bruno- commented Sep 12, 2014

Wow, I'm happy that someone other than me actually uses the plugin!

  1. session search should be case insensitive

    This is a valid request. Currently this plugin just delegates session switching to tmux's switch-client command so the implementation is very small - check it here. Changing this would require comparably much more code (and work & time). For now I'm fine accepting a pull request that implements this and helping around it.

    Also, I'm curious, how come you have mix/upper case session names? Don't you find lowercase session names easier to create?
  2. "give a filtered output if more than one session matches the search string"

    This one should be easier to implement. I've opened issue with <prefix + g> when multiple sessions match, give filtered output #3 for this and will work on it when there's time. Let me know if you want to get your hands dirty and get it done faster.

@vendion
Copy link
Author

vendion commented Sep 17, 2014

Well I only just found out out this, and Tmux plugins in general so I figured I would give it a try.

  1. Yeah I see what you mean, the output from the switch-client would have to be captured and filtered with-in the loop. The reason I have some sessions is I run one session per project, and some of the names are abbreviations (which in my mind are uppercased, comes from working with Go). For for example I have a session named "ORNL" (Oak Ridge National Labs) and one named "GDG-gigcity" (Google Developer Group Gigcity). In my mind I see that and know right off the bat they are abbreviations, sure not everyone has that mindset though.
  2. I haven't don't any Tmux plugin development so I'm not sure how much I will be able to contribute but would be more than happy to help anyway I can.

@javier-lopez
Copy link

Hi,

Just wanted to comment that 1 doesn't necessarily requires a lot of more code, I was able to implement a case insensitive search by placing grep -i between list sessions and user input.

https://github.com/chilicuil/tundle-plugins/blob/master/tmux-sessionist/scripts/switch_or_loop.sh#L11

In the second regard, by modifying list_sessions.sh to accept input data you could create a loop to give feedback if more than 1 entry matches the search pattern.

https://github.com/chilicuil/tundle-plugins/blob/master/tmux-sessionist/scripts/list_sessions.sh#L9

I could work in a pull request if the approach seems ok for this plugin.

@yevhen-m
Copy link

yevhen-m commented Feb 14, 2017

@bruno- Maybe you'd like to consider using fzf for session switching.

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

4 participants