asynctasks.vim icon indicating copy to clipboard operation
asynctasks.vim copied to clipboard

Can't recognized root directory when use terminal to output

Open qsdrqs opened this issue 5 years ago • 4 comments

Hello! It's a nice vim plugin and I get a lot of benefit from it! But I meet a problem that I can't change to my root directory on terminal output mode. Here is my project tree.

.
├── .root
├── src
│   └── 1.cpp
└── .tasks

When I open 1.cpp in src directory, and run asynctasks configured like that:

[file-build]
command=pwd
cwd=$(VIM_ROOT)

output=terminal

It shows

/home/qsdrqs/test/src

[Process exited 0]

When I change output into quickfix, it shows

|| [pwd]
|| /home/qsdrqs/test
|| [Finished in 0 seconds]

In a word, the "terminal" mode may not works well in changing directory.

qsdrqs avatar Jun 20 '20 03:06 qsdrqs

I can't reproduce your problem, could you diagnose this with:

:echo asyncrun#get_root('%')

And see if the output is correct.

skywind3000 avatar Jun 21 '20 22:06 skywind3000

I can't reproduce your problem, could you diagnose this with:

:echo asyncrun#get_root('%')

And see if the output is correct.

Yes, it is correct.

I make some steps to reproduce this problem, at least it works for me.

  1. create a directory called test and cd into it
  2. create a empty file .root
  3. create a directory called src and cd into it
  4. create a file called 1.c and use vim to edit it.
  5. config vimrc file as below:
Plug 'skywind3000/asynctasks.vim'
Plug 'skywind3000/asyncrun.vim'
let g:asyncrun_open = 7

let g:asynctasks_confirm=0
let g:asynctasks_term_pos = 'bottom'
let g:asynctasks_term_rows = 14

6.use

:AsyncTaskEdit

to edit .task file (which is correctly at the ".root" position)

[file-build]
command=pwd
cwd=$(VIM_ROOT)
output=terminal

save it. 7.use

:AsyncTask file-build

then it shows

/home/qsdrqs/test/src

[Process exited 0]

I have noticed that when I config

let g:asynctasks_term_pos 

as quickfix , vim , tab and external it just works well. But when I set it as top , bottom , left and right , it shows the wrong directory.

qsdrqs avatar Jun 22 '20 13:06 qsdrqs

what is your vim version number ?? operating system ??

skywind3000 avatar Jun 23 '20 03:06 skywind3000

what is your vim version number ?? operating system ??

My vim version is 8.2, OS is archlinux and kernel version is 5.7.2

I noticed a trick that if I add cd $(VIM_ROOT) before pwd and the :AsyncTask file-build will show the correct result.

qsdrqs avatar Jun 23 '20 03:06 qsdrqs