Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect cwd when call vim with '-c cd xxx' #5037

Open
aispeaking opened this issue Jun 11, 2024 · 0 comments
Open

Incorrect cwd when call vim with '-c cd xxx' #5037

aispeaking opened this issue Jun 11, 2024 · 0 comments

Comments

@aispeaking
Copy link
Contributor

aispeaking commented Jun 11, 2024

Result from CocInfo

versions

vim version: VIM - Vi IMproved 9.0 9001563
node version: v20.12.0
coc.nvim version: 0.0.82-c3ae5c3 2024-05-23 20:39:40 +0800
coc.nvim directory: /home/liyt/code/extern/vim-runtime/plugged/coc.nvim
term: dumb
platform: linux

Log of coc.nvim

2024-06-11T16:20:08.984 INFO (pid:852781) [extension:coc-git] - Looking for git in: git
2024-06-11T16:20:09.017 WARN (pid:852781) [workspace] - Extension "undefined" registered synchronized autocmd "VimLeavePre", which could be slow.
2024-06-11T16:20:10.176 INFO (pid:852781) [plugin] - coc.nvim initialized with node: v20.12.0 after 1423
2024-06-11T16:20:10.297 INFO (pid:852781) [extension:@yaegassy/coc-marksman] - marksman binary is already downloaded
2024-06-11T16:20:10.302 INFO (pid:852781) [language-client-index] - Language server "marksman" started with 852834
2024-06-11T16:20:10.343 INFO (pid:852781) [attach] - receive notification: doAutocmd [ 7 ]
2024-06-11T16:20:11.911 INFO (pid:852781) [extension:@yaegassy/coc-marksman] - Client onReady
2024-06-11T16:20:11.943 INFO (pid:852781) [extension:@yaegassy/coc-marksman] - Got marksman/status notification
2024-06-11T16:20:15.053 INFO (pid:852781) [attach] - receive notification: openList [ 'mru' ]
2024-06-11T16:20:15.054 INFO (pid:852781) [extension:coc-lists] - cwd: /home/liyt/.config/coc/extensions/node_modules/coc-lists/lib
2024-06-11T16:20:15.088 INFO (pid:852781) [extension:coc-lists] - files: /share/note/notebook.md
2024-06-11T16:20:15.095 INFO (pid:852781) [attach] - receive notification: doAutocmd [ 2, 2 ]
2024-06-11T16:20:15.114 INFO (pid:852781) [attach] - receive notification: doAutocmd [ 7 ]
2024-06-11T16:20:16.677 INFO (pid:852781) [attach] - receive notification: doAutocmd [ 7 ]
2024-06-11T16:20:16.727 INFO (pid:852781) [attach] - receive notification: doAutocmd [ 7 ]
2024-06-11T16:20:22.525 INFO (pid:852781) [attach] - receive notification: openList [ 'mru' ]
2024-06-11T16:20:22.526 INFO (pid:852781) [extension:coc-lists] - cwd: /share/note
2024-06-11T16:20:22.556 INFO (pid:852781) [extension:coc-lists] - files: /share/note/notebook.md
2024-06-11T16:20:22.567 INFO (pid:852781) [attach] - receive notification: doAutocmd [ 2, 3 ]
2024-06-11T16:20:22.584 INFO (pid:852781) [attach] - receive notification: doAutocmd [ 7 ]
2024-06-11T16:20:23.560 INFO (pid:852781) [attach] - receive notification: doAutocmd [ 7 ]
2024-06-11T16:20:26.440 INFO (pid:852781) [attach] - receive notification: showInfo []

Describe the bug

When using vim /share/note/notebook.md -c 'cd /share/note and then open mru list, no recent files in /share/note exist.

I add some log to print the cwd in mru list and found it is not the expected one as :pwd.

Reproduce the bug

  1. Open terminial and cd to any directory A.
  2. Open file in another directory B and cd to B in vim arguments: vim /B/test.txt -c 'cd /B'. Make sure B is not a sub dir of A.
  3. Call CocList mru in vim. /B/test.txt is not there.
  4. Call cd /B in vim.
  5. Call CocList mrc again. /B/test.txt is in the list.

Screenshots (optional)

If applicable, add screenshots to help explain your problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant