Welcome to Vifm Q&A, where you can ask questions about using Vifm. Registration is optional, anonymous posts are moderated. E-mail and GitHub logins are enabled.
0 votes
in vifm by
edited by

Hello everyone,

I encounter a strange issue. I have a remote fs mounted (with sshfs) locally in ~/monster (both remote are Arch linux systems).

When copyng a big (2G) file to ~/monster using ":copy &" from a local directory, vifm either completly freezes until completion, or at best is barely responsive.

Now when I do the exact same operation the other way around (from ~/monster to a local directory), everything works perfectly, I can smoothly use vifm while the operation is running with a nice progress bar.

Also, when I copy locally a file using vifm, no freezes, so the problem is really with the sshfs mounted directory "~/monster".

Here is the command I'm using to mount the remote fs :

sshfs johny@monster:/home/johny ~/monster

And here is my vifmrc :

set viewcolumns=-40%{name},{target},10%{size},10%{mtime},10%{uname},10%{gname},10%{perms}
set dotfiles
set sort=+dir,+iname,-mode
set showtabline=always
set tabscope=pane
set vicmd=nvim
set syscalls
set trash
set history=100
set nofollowlinks
set fastrun
set sortnumbers
set undolevels=100
set vimhelp
set norunexec
colorscheme gruvbox
set timefmt=%m/%d\ %H:%M
set wildmenu
set wildstyle=popup
set suggestoptions=normal,visual,view,otherpane,keys,marks,registers
set ignorecase
set smartcase
set nohlsearch
set incsearch
set scrolloff=8
highlight User1 ctermbg=yellow ctermfg=black
highlight User2 ctermbg=none ctermfg=blue cterm=bold
highlight User3 ctermbg=none ctermfg=red cterm=bold
highlight User4 ctermbg=none ctermfg=yellow cterm=bold
highlight User5 ctermbg=non3 ctermfg=purple
set statusline="%1* %-10t %2* %u:%-7g %5* %s %3* %A"
command! df df -h %m 2> /dev/null
command! diff vim -d %f %F
command! zip zip -r %f.zip %f
command! run !! ./%f
command! make !!make %a
command! mkcd :mkdir %a | cd %a
command! vgrep vim "+grep %a"
command! reload :write | restart
command! mkd :mkdir %a
" PDF, DJVU, EPUB, ...
filextype *.pdf,*.djvu,*.epub zathura %f &> /dev/null &
fileviewer *.pdf,*.djvu,*.epub vifmimg pdf %px %py %pw %ph %c %pc vifmimg clear
" VDEOS
filextype *.avi,*.mp4,*.wmv,*.mkv,*.mpg,*.mpeg,*.vob,*.mov,*.webm,*.m4v mpv %f &> /dev/null &
fileviewer <video/*> mediainfo %c
" IMAGES
filextype *.png,*.jpg,*jpeg,*.bmp,*.gif,*.xpm shotwell %f &>  /dev/null &
fileviewer <image/*> mediainfo %c
" AUDIO
filextype *.mp3 mpv %f &> /dev/null &
fileviewer <audio/*> mediainfo %c
set vifminfo=dhistory,chistory,state,tui,shistory,phistory,fhistory,dirstack,registers,bookmarks,bmarks
nnoremap O :!doas nvim %f<cr>
nnoremap p :put &<cr>
nnoremap <space>t :tabnew<cr>
nnoremap <space>j :tabprevious<cr>
nnoremap <space>k :tabnext<cr>
nnoremap <space>x :tabclose<cr>
nnoremap bb :bmgo<cr>
nnoremap ,m :cd /home/vilanele/music/<cr>
nnoremap ,t :cd /home/vilanele/torrent/<cr>
nnoremap ,v :cd /home/vilanele/video/<cr>
nnoremap ,d :cd /home/vilanele/qutedl/<cr>
nnoremap ,h :cd /home/vilanele/<cr>
nnoremap ,p :cd /home/vilanele/pconf<cr>
nnoremap ,c :cd /home/vilanele/.config<cr>
nnoremap . za
nnoremap sx :!sxiv -tr %d & <cr>
nnoremap bg :!xwallpaper --zoom %f <cr>
nnoremap wp :!xwallpaper --zoom %f <cr>
nnoremap gp :!gimp %f & <cr>
nnoremap s :shell<cr>
nnoremap S :sort<cr>
nnoremap n :view<cr>
vnoremap w :view<cr>gv
nnoremap gb :file &<cr>l
if has('win')
    " Yank current directory path to Windows clipboard with forward slashes
    nnoremap yp :!echo %"d:gs!\!/! %i | clip<cr>
    " Yank path to current file to Windows clipboard with forward slashes
    nnoremap yf :!echo %"c:gs!\!/! %i | clip<cr>
elseif executable('xclip')
    " Yank current directory path into the clipboard
    nnoremap yd :!echo %d | xclip %i<cr>
    " Yank current file path into the clipboard
    nnoremap yf :!echo %c:p | xclip %i<cr>
elseif executable('xsel')
    " Yank current directory path into primary and selection clipboards
    nnoremap yd :!echo -n %d | xsel --input --primary %i &&
                \ echo -n %d | xsel --clipboard --input %i<cr>
    " Yank current file path into into primary and selection clipboards
    nnoremap yf :!echo -n %c:p | xsel --input --primary %i &&
                \ echo -n %c:p | xsel --clipboard --input %i<cr>
endif
nnoremap I cw<c-a>
nnoremap cc cw<c-u>
nnoremap A cw
nnoremap q :q<cr>
nnoremap ,w :set wrap!<cr>
nnoremap <f3> :!less %f<cr>
nnoremap <f4> :edit<cr>
nnoremap <f5> :copy<cr>
nnoremap <f6> :move<cr>
nnoremap <f7> :mkdir<space>
nnoremap <f8> :delete<cr>
source /home/vilanele/.config/vifm/favicons.vifm
" vim: ft=vim

1 Answer

0 votes
by

Hello,

I think the issue is caused by monitoring mounted directory for changes while a file in it is being updated. It all has to go through sshfs which likely forces Vifm to wait on a synchronous operation (not just the instance which does the copying). Both as a confirmation of the guess and as a workaround this should work fine (it makes a difference for me):

:co ~/monster &

provided that none of the visible panes are under ~/monster path. There is 'slowfs' option which actually includes fuse.sshfs in my configuration, but that's not enough to address this.

Thanks, I'll have to look into why exactly this happens and if 'slowfs' can take it into account.

by

It's working (almost) fine by either specifying the target path in the copy command as you suggested or by adding set slowfs+=~/monster to my vifmrc.

By 'almost,' I mean that using either method, the UI navigation still suffers a very small latency (around 0.2 seconds) when moving horizontally in the filesystem (using h and l keys) during the copy to ~/monster.

It's totally bearable, but I think it should not happen in normal behavior (and it's not happening outside of local -> ~monster copy).

Moreover, I've noticed that when copying from ~/monster -> local this time, the progress bar percentage is not updated when the slowfs option is set, so tracking progress is not possible (that might be expected I guess ?)

Thanks for your fast answer

by

or by adding set slowfs+=~/monster to my vifmrc.

That's unexpected, maybe fuse.sshfs doesn't have the effect in mount root or something.

Moreover, I've noticed that when copying from ~/monster -> local this time, the progress bar percentage is not updated when the slowfs option is set, so tracking progress is not possible (that might be expected I guess ?)

This could be indirectly related because fewer directory updates mean fewer redraws of the job bar, so percentage could just be updated more slowly.

...