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

if-shell always get false result? #495

Closed
wyntau opened this issue Aug 1, 2016 · 3 comments
Closed

if-shell always get false result? #495

wyntau opened this issue Aug 1, 2016 · 3 comments

Comments

@wyntau
Copy link

wyntau commented Aug 1, 2016

Because tmux 2.2 had removed some options only available before 2.2, but my server's tmux is old. So I want to have version detect in my tmux.conf to set some options only on old version.

But I found if-shell will always get false result?

my screenshot
image

my tmux version is 2.2, and I use zsh as my default shell.

could anyone help me correctly detect tmux version in tmux.conf?

@wyntau
Copy link
Author

wyntau commented Aug 1, 2016

I get the anwser.

  1. -lt -le -gt -ge are only used for integer
  2. string compare more than or equal, I have to use [[ $a == 'string' ]] || [[ $a > 'string' ]]

So this issue closed.

@wyntau wyntau closed this as completed Aug 1, 2016
@douglasdd
Copy link

Also NOTE: only POSIX shell syntax is officially supported for if-shell, so bash/zsh extensions (like [[) might work (or might not) -- depending on whether your /bin/sh is a symlink to /bin/bash (will work), or a symlink to /bin/dash (won't work), or something else entirely.

@lock
Copy link

lock bot commented Feb 15, 2020

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked and limited conversation to collaborators Feb 15, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

2 participants