Thank you! The #{config_files} works for me, and I have only one config 
file.

On Wednesday, April 16, 2025 at 5:30:40 PM UTC+8 Nicholas Marriott wrote:

Or you could use #{config_files} instead which is always set, but be 
careful if you have >1 config file.



On Wed, 16 Apr 2025 at 10:29, Nicholas Marriott <nicholas...@gmail.com> 
wrote:

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 <japin...@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+...@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/24801640-9a57-4783-9d37-5a8f8fb673fan%40googlegroups.com.

Reply via email to