Thanks Nicholas,

#{} (curly braces) is parsed by the setenv command, though:

$ tmux setenv -ghF _tmux_test '#{version}x'
$ tmux showenv -gh _tmux_test
_tmux_test=3.4x

Any chance #() could be added to setenv in the future?

In the mean time I'll get my hook to run a shell script that calls tmux 
setenv.

Scott
On Saturday, November 2, 2024 at 2:00:54 AM UTC+11 Nicholas Marriott wrote:

> Yes, #() can only be used in the status line.
>
> You'll probably need to run a script with "run-shell" that does it.
>
>
> On Fri, 1 Nov 2024 at 14:57, Scott Aitken <goo...@thismonkey.com> wrote:
>
>> HI,
>> I want to set a variable (preferably hidden) from a pane with setenv and 
>> and read it with showenv but I'm struggling:
>>
>> $ tmux setenv -ghF _tmux_test '#(uptime)x'
>> $ tmux showenv -gh _tmux_test
>> _tmux_test=x
>>
>> Does the setenv command not support the FORMATS #() syntax?
>>
>> My ultimate aim is to set a variable each time a pane takes focus (with a 
>> hook) then read that variable in the status line.
>>
>> Thanks
>>
>> -- 
>> 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/3428caa6-1d5e-4b6c-b4aa-524a06c56faen%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/tmux-users/3428caa6-1d5e-4b6c-b4aa-524a06c56faen%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion, visit 
https://groups.google.com/d/msgid/tmux-users/a5b8b3da-aa72-4e59-98f4-c00b4e6a0ff8n%40googlegroups.com.

Reply via email to