skywind3000 / asyncrun.vim

:rocket: Run Async Shell Commands in Vim 8.0 / NeoVim and Output to the Quickfix Window !!
https://www.vim.org/scripts/script.php?script_id=5431
MIT License
1.86k stars 111 forks source link

backgroud is still running #218

Closed YLShiJustFly closed 3 years ago

YLShiJustFly commented 3 years ago

I use asyncrun.vim to async run a shell script when I save file, the shell script scp my file to remote server. but when I :w, it print "backgroud jobs is still running". and then i should print enter to return to vim. Actually the file is sent to remote server successfully. But every time the problem makes me really upset. My shell script call an expect script to fill password automatically. I am on MacOS 11.1 use vim8.2

my shell script call expect:

expect /Users/shiyaoliang/Develop/c/sendtoremote/sendfile.exp $PORT $USER $IP $PASSWORD $LOCALFILES $REMOTEFILES echo "scopy files to remote is over!" exit 0

my except script:

!/usr/local/bin/expect

set timeout 10

set port [lindex $argv 0] set username [lindex $argv 1] set hostip [lindex $argv 2] set password [lindex $argv 3] set localfiles [lindex $argv 4] set remotefiles [lindex $argv 5]

spawn scp -r -P $port $localfiles $username@$hostip:$remotefiles expect { "yes/no" {send "yes\r";exp_continue} "password:" {send "$password\r"} } expect eof exit

Appreciate your work! Thank you!

YLShiJustFly commented 3 years ago

i update to the newest version, the problem does not exist.