--
You received this message because you are subscribed to the Google Groups "tmux-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tmux-users+...@googlegroups.com.
To view this discussion, visit https://groups.google.com/d/msgid/tmux-users/8e11fff3-e0df-4266-aaf4-1977971cdc04n%40googlegroups.com.
Couldn't you just remove all non-numbers from the string to get a number version?
On Fri, 18 Apr 2025, 06:53 japin li, <japin...@gmail.com> wrote:
Hi, Nicholas
I found that Tmux has a version variable in string format (like next-3.5). However, this does not facilitate easier version comparison. Currently, I use the following to do version comparsion:%if #{>=:#{s|next-||:version},3.5}do something%endif--Would it be possible to add a numeric server version? Or is there another effective way to compare versions?
You received this message because you are subscribed to the Google Groups "tmux-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tmux-users+unsubscribe@googlegroups.com.
Thanks, it's pretty cool.On Sunday, April 20, 2025, Nicholas Marriott <nicholas...@gmail.com> wrote:Couldn't you just remove all non-numbers from the string to get a number version?On Fri, 18 Apr 2025, 06:53 japin li, <japin...@gmail.com> wrote:Hi, Nicholas
I found that Tmux has a version variable in string format (like next-3.5). However, this does not facilitate easier version comparison. Currently, I use the following to do version comparsion:%if #{>=:#{s|next-||:version},3.5}do something%endif--Would it be possible to add a numeric server version? Or is there another effective way to compare versions?
You received this message because you are subscribed to the Google Groups "tmux-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tmux-users+...@googlegroups.com.
To view this discussion, visit https://groups.google.com/d/msgid/tmux-users/f98d5057-8566-4d91-a8f3-1100ded98fecn%40googlegroups.com.
What if you append a '0' to the end if there's no letter, and if there is a letter, convert that to a number. How about something like this:echo '3.2a' | sed -e 's/\([0-9]\)$/\10/;s/\.//g' | tr '0123456789abcdefghi' '0123456789123456789'
which produces 321 and without the a produces 320. Thing is, in the future, who knows if a version 9a or 14b.6 will come out.However, I agree, adding a numeric version would be a good idea. I have also had to do above hacks like the above on other things.
--
You received this message because you are subscribed to the Google Groups "tmux-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tmux-users+...@googlegroups.com.
To view this discussion, visit https://groups.google.com/d/msgid/tmux-users/d4e34b5c-d5a9-4e40-83e5-40f8d02cbde1n%40googlegroups.com.