Noticed, that if i use ,c that's shortcut to open my vifmrc file the behavior differs depending on if vifm started from shell of from either tmux or screen
In the first case it works as expected - opens my vifm rc file in editor,
in the latter case however it just open editor with no file.
I have default keymapping
nnoremap ,c :write | execute ':!vim $MYVIFMRC' | restart<cr>
and it's obvious thtat MYVIFM variable is undefined/empty.
I have a vague feeling it's somehow relates to the manner tmux runs/executes (sub)shell
But no enlightenment so far.
Current (since 0.8.2) version of the binding is this:
nnoremap ,c :write | edit $MYVIFMRC | restart<cr>
It also accounts for 'vicmd' option, so is a better choice.
Another way of getting it fixed is to use %n macro to suppress using terminal multiplexer like this:
nnoremap ,c :write | execute ':!vim $MYVIFMRC %n' | restart<cr>
The reason it's needed is that environment variables are passed from process parents to their children and in the case of terminal multiplexers they are the parents. There are ways to change their environment too, but since it can potentially affect too many unrelated processes, only selected variables are propagated this way.
When :edit is used, vifm does the expansion locally and shell gets expanded path, but with :execute !... command is passed to terminal multiplexer without expansion of environment variables and it's done on their side where there is no $MYVIFMRC as you've discovered.
Explained nice way, thanks a lot!