-
Notifications
You must be signed in to change notification settings - Fork 394
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
Focus cursor on the file after moving it to a target dir #1950
Comments
Duplicate of #1706 |
Ah, I used different keywords when searching through the existing issues. Thanks! |
Since the linked conversation appears to be locked, I'll ask here: Would the following work? |
Can you explain your proposal in more detail? For example, are you suggesting creating it in Yazi's file system (file list) or actually creating it on the operating system's file system? How would cutting and copying work in each case? What happens if the creation of a new file fails? What if the file is created successfully, but copying or cutting fails? When dealing with multiple files, how would copying and cutting work? Would it create only the first file or all of them? |
This is indeed a not-so-straightforward area of operating on partially transferred files. I don't know the internal mechanics of yazi, but from a UX perspective yazi appears to already have this type of user interaction: When copying a large file or directory to a new location, the new file shows up while the transfer is still in progress. I propose to simply place the focus / cursor on the new file. So, to answer your first question: whatever way yazi currently handles partially-transferred files would be preserved, the only difference is that the focus would be on the new file right away. In situations when yazi would remove the new file from the listing, due to e.g. unsuccessful transfer, the cursor could be moved to another file, e.g. returned to the position before the transfer start. This however might cause some UX issues if the user was in the middle of an attempt to perform an action on the new file (e.g. trying to delete it by pressing When transferring multiple files, any reasonable option would be fine for the purposes of this issue. For instance, placing it on the first file that has started the transfer. |
yazi --debug
outputPlease describe the problem you're trying to solve
After moving a file to a new location (focusing the cursor on the file, pressing
x
, then navigating to a different directory, and pressingp
), the cursor will still be on the first file in the directory. In some situations, it would be helpful if the focus was placed on the file being moved.Would you be willing to contribute this feature?
Describe the solution you'd like
After pressing
p
the focus / cursor is placed on the new file.Additional context
This is useful when some additional action with the moved file needs to be taken. For example, when xdg-desktop-portal-termfilechooser uses yazi (with
--chooser-file
argument) to save a file, it is often necessary to first move the file to a different location, after which the file is selected (withEnter
), its path is then passed totermfilchooser
, and the file is saved at that path.With the current situation, after moving the file (pressing
p
), it is necessary to find the new file among all the other files already in the dir, put the cursor on it, and pressEnter
. Depending on how many files are already in the dir, and how distinctively the new file is named, this might be not effortless.Perhaps there could be a switch / argument for it. Or it could be automatically enabled when
--chooser-file
is active. But offhand it seems like this might be convenient even enabled by default.Somewhat relevant: #1136 for other suggestions to making yazi more convenient to use with termfilechooser.
Related in case this is advised to be implemented with a plugin: #1713 (comment) Tips on
p
action code.Validations
The text was updated successfully, but these errors were encountered: