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

[Bug] open a folder with Chinese name and trigger jump fzf to search and select a file, nothing is visible. #108

Closed
DreamMaoMao opened this issue Sep 5, 2023 · 32 comments · Fixed by #121 or #125
Labels
waiting on op Waiting for more information from the original poster
Milestone

Comments

@DreamMaoMao
Copy link

DreamMaoMao commented Sep 5, 2023

This problem is very strange, and will only happen the first time, when you can not see file list in the current path, press the left arrow key, then press the right arrow key, the file in the current path can be saw again .

After that, I repeated the first operation (jump fzf to search and select a file in the same path). After the selection, I can see file list in the path.

@DreamMaoMao
Copy link
Author

first time:

2023-09-05.16-10-21.mp4

@DreamMaoMao
Copy link
Author

press left key and right key:

2023-09-05.16-11-40.mp4

@DreamMaoMao
Copy link
Author

secode time search:

2023-09-05.16-12-37.mp4

@sxyazi
Copy link
Owner

sxyazi commented Sep 5, 2023

Thank you for your report. I will investigate it.

@sxyazi
Copy link
Owner

sxyazi commented Sep 5, 2023

I cannot reproduce this issue on the latest HEAD. Please try the latest code to see if the issue has gone.

issue-108.mp4

@sxyazi sxyazi added the waiting on op Waiting for more information from the original poster label Sep 5, 2023
@DreamMaoMao
Copy link
Author

My code is the latest one. The problem still remains.

The strange thing is that I have tried other paths. Some paths don't trigger this issue, while others can stably trigger this issue.

@sxyazi
Copy link
Owner

sxyazi commented Sep 6, 2023

Do they have any patterns, and how can I reproduce them?

@DreamMaoMao
Copy link
Author

I found the Rules that trigger bugs. I have a path that is
~/down

And then I have keymap config:

{ on = [ "g", "d" ],       exec = "cd ~/down",   desc = "Go to the downloads directory" },

The down path create method is:

ln -s /media/wrq/UUI/down  ~/down

This problem occurs when I use the yazi gd command to open ~/down and then jump fzf. Other directories don't have this problem

That is to say, only the Chinese folder in the soft link directory has this problem

@DreamMaoMao
Copy link
Author

if i directly open path /media/wrq/UUI/down to test, there is no problem. only when i open ~/down which is soft link to /media/wrq/UUI/down,the bug will occur

@sxyazi
Copy link
Owner

sxyazi commented Sep 6, 2023

Sounds like it might be related to symbolic links. I will investigate it further.

@DreamMaoMao
Copy link
Author

DreamMaoMao commented Sep 6, 2023

image

directly open path /media/wrq/UUI/down:

2023-09-06.16-20-11.mp4

open ~/down:

2023-09-06.16-20-37.mp4

@DreamMaoMao
Copy link
Author

There are other bugs about link path. After opening link path, whether it is deleted, created, or renamed, it will automatically trigger a jump to the previous level of directory

@sxyazi
Copy link
Owner

sxyazi commented Sep 6, 2023

There are other bugs about link path. After opening link path, whether it is deleted, created, or renamed, it will automatically trigger a jump to the previous level of directory

Can you record a GIF for this?

@DreamMaoMao
Copy link
Author

There are other bugs about link path. After opening link path, whether it is deleted, created, or renamed, it will automatically trigger a jump to the previous level of directory还有其他关于链接路径的bug。打开链接路径后,无论是删除、创建还是重命名,都会自动触发跳转到上一级目录

Can you record a GIF for this?你能为这个录个GIF吗?

2023-09-06.17-12-12.mp4

@sxyazi
Copy link
Owner

sxyazi commented Sep 7, 2023

I made a PR to fix this, can you take a look if the issue has gone

#121

@DreamMaoMao
Copy link
Author

I made a PR to fix this, can you take a look if the issue has gone我做了一个公关来解决这个问题,你能看看这个问题已经解决了吗

#121

The problem has been solved

@sxyazi
Copy link
Owner

sxyazi commented Sep 7, 2023

Thanks for the testing

@DreamMaoMao DreamMaoMao reopened this Sep 7, 2023
@DreamMaoMao
Copy link
Author

It's a little strange that after I updated the main branch code to compile, I found that the first fzf problem was solved, and the problem that automatic jump to the upper level directory was still not solved

Then I went back to test the pr branch and found the same thing, the problem that automatic jump problem appeared again

@sxyazi
Copy link
Owner

sxyazi commented Sep 7, 2023

Unfortunately I can't reproduce the issue, it works fine on my side.

I created a symlink directory as you did and put it under HOME, then added files and deleted files to it, but did not encounter a "leave".

123.mp4

@DreamMaoMao
Copy link
Author

DreamMaoMao commented Sep 7, 2023

I know why the first time I tested no problem, because I tested fzf first, but after the test,fzf jumped to the real path, so the automatic leave directory is not a valid test

@sxyazi
Copy link
Owner

sxyazi commented Sep 7, 2023

I'm not sure how to reproduce your issue. Could you try applying the following patch, then perform the same operation, and paste the results of cat ~/.local/state/yazi/yazi.log here?

diff --git forkSrcPrefix/core/src/manager/watcher.rs forkDstPrefix/core/src/manager/watcher.rs
index 1e6c3fcd041c9600d711e831b0ca79d481f61e89..6962b8a7f64649a27458bc670cb02115a462e74e 100644
--- forkSrcPrefix/core/src/manager/watcher.rs
+++ forkDstPrefix/core/src/manager/watcher.rs
@@ -6,6 +6,7 @@ use parking_lot::RwLock;
 use shared::Url;
 use tokio::{fs, pin, sync::mpsc::{self, UnboundedReceiver}};
 use tokio_stream::{wrappers::UnboundedReceiverStream, StreamExt};
+use tracing::info;
 
 use crate::{emit, external, files::{File, Files, FilesOp}};
 
@@ -156,6 +157,7 @@ impl Watcher {
 	}
 
 	async fn file_changed(urls: &[Url], watched: Arc<RwLock<IndexMap<Url, Option<Url>>>>) {
+		info!("file changed: {:?}", urls);
 		let Ok(mut mimes) = external::file(urls).await else {
 			return;
 		};
@@ -177,6 +179,7 @@ impl Watcher {
 	}
 
 	async fn dir_changed(url: &Url, watched: Arc<RwLock<IndexMap<Url, Option<Url>>>>) {
+		info!("dir changed: {:?}", url);
 		let linked: Vec<_> = watched
 			.read()
 			.iter()

By the way, it seems like your password got leaked in the video...

@DreamMaoMao
Copy link
Author

thanks i will try tomorrow

@DreamMaoMao
Copy link
Author

before patch , i have see many error in the log ,
image

@sxyazi
Copy link
Owner

sxyazi commented Sep 7, 2023

You can do a file -bL --mime-type /home/wrq/down and file -bL --mime-type /home/wrq/test manually to see what was happening

@DreamMaoMao
Copy link
Author

You can do a file -bL --mime-type /home/wrq/down and file -bL --mime-type /home/wrq/test manually to see what was happening您可以手动执行 file -bL --mime-type /home/wrq/downfile -bL --mime-type /home/wrq/test 以查看发生了什么

image

@DreamMaoMao
Copy link
Author

DreamMaoMao commented Sep 8, 2023

2023-09-08.08-34-36.mp4

the error caused the automatic jump

@DreamMaoMao
Copy link
Author

image
after patch:

2023-09-08.08-48-26.mp4

log:

yazi.log

@sxyazi
Copy link
Owner

sxyazi commented Sep 8, 2023

Not sure why /home/wrq/down is being recognized as a file.

This might be a Linux-specific behavior. I'll install a Linux to test it shortly.

@DreamMaoMao
Copy link
Author

Not sure why /home/wrq/down is being recognized as a file.不知道为什么 /home/wrq/down 被识别为文件。

This might be a Linux-specific behavior. I'll install a Linux to test it shortly.这可能是Linux特有的行为。我将安装一个Linux来测试它。

The linux symlink seems to be a special file

@sxyazi
Copy link
Owner

sxyazi commented Sep 8, 2023

The linux symlink seems to be a special file

That makes sense. Please try the new PR #125

@DreamMaoMao
Copy link
Author

it work now

@github-actions
Copy link

I'm going to lock this issue because it has been closed for 30 days. ⏳ This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 27, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
waiting on op Waiting for more information from the original poster
Projects
None yet
2 participants