You're not running it from a config file, you're running it from a key
binding, so there is no current file.

Put this in .tmux.conf and then use #{d:CONFIG_FILE} instead:

setenv -ghF CONFIG_FILE '#{current_file}'


On Wed, 16 Apr 2025 at 10:26, japin li <japinli...@gmail.com> wrote:

> Hi,
>
> As $subject said, I want to get TMUX directory in .tmux.conf, since I have
> the following configuration layout.
>
> $ tree ~/.tmux
> /home/japin/.tmux
> ├── personal.conf
> ├── README.md
> ├── scripts
> │   └── fzf-session.sh
> └── tmux.conf
>
> And I have the following setting in tmux.conf
>
> bind J run-shell "tmux popup -E -w 40% -h %30
> #{d:current_file}/scripts/fzf-session.sh"
>
> When I execute C-b J, it complains as following:
> 'tmux popup -E -w 40% -h %30 /scripts/fzf-session.sh' returned 1
>
> According to the documentation [1],  formats are expanded in the run-shell
> argument.
> It seems that #{d:current_file} is empty.  How can I fix this? Or is it
> possible to get the tmux directory?
>
> [1] https://github.com/tmux/tmux/wiki/Advanced-Use#running-shell-commands
>
> --
> 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/d737c49e-71d3-4ac7-a26b-d67bf2260ad6n%40googlegroups.com
> <https://groups.google.com/d/msgid/tmux-users/d737c49e-71d3-4ac7-a26b-d67bf2260ad6n%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/CAEdLfcGUj929wfVOTLW5NZFYu3jiVXmYTg7sYjr-MbfmT9FZTQ%40mail.gmail.com.

Reply via email to