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

Copy filename etc. not working + two possible feature requests. #70

Closed
Gajus84 opened this issue Aug 19, 2023 · 18 comments
Closed

Copy filename etc. not working + two possible feature requests. #70

Gajus84 opened this issue Aug 19, 2023 · 18 comments

Comments

@Gajus84
Copy link

Gajus84 commented Aug 19, 2023

Thank you first for this great project. Yazi already includes many features out of the box, which fit my workflow.

One of them, copying filename, path etc. however does not work in my Hyprland system so far. I suspect that wl-copy is not recognized or called.

Furthermore it seems to be currently not possible to pass selected file(s) path(s) to the shell in a command? Analogous to the method in yazi.toml, this would greatly extend the flexibility of the inbuild shell.
Use case is e.g. adding files in Chezmoi by key command. Currently I "abuse" the interactiv opener for this.

Also, it would be nice to be able to assign mouse actions in keymap.toml as well. Even though a terminal program is primarily designed for keyboards, it would be nice to be able to use extra mouse keys as well. Also I could customize the scroll function. Currently I always skip three lines per scroll, which limits the usage a bit.

@sxyazi
Copy link
Owner

sxyazi commented Aug 19, 2023

Hi, thanks for your appreciation!

One of them, copying filename, path etc.

The copy file path feature is included in the feature requests, and has not been implemented yet, I will implement it now!

Furthermore it seems to be currently not possible to pass selected file(s) path(s) to the shell in a command?

Good idea, I will implement it together!

it would be nice to be able to assign mouse actions in keymap.toml as well

I'll add it to feature requests and implement it sometime later, PRs are welcome of course!

@Gajus84
Copy link
Author

Gajus84 commented Aug 19, 2023

The copy file path feature is included in the feature requests, and has not been implemented yet, I will implement it now!

Thank you! I compiled with the merge. Unfortunately it still did not work. I was using the default config to make sure that there is no error in mine.
Is there anything I could do to test?

Edit: Oh, you are working on the second part of the request, maybe I was just too impatient.

@sxyazi
Copy link
Owner

sxyazi commented Aug 19, 2023

Yep, the first two features are merged, you can try it now!

The last feature has been included in the feature requests, can I close this issue in favor of that?

@Gajus84
Copy link
Author

Gajus84 commented Aug 19, 2023

Merged and tested. Second one works.

Copying filename, path etc. still doesn't.

@sxyazi
Copy link
Owner

sxyazi commented Aug 19, 2023

What is your desktop environment and what clipboard command do you use?

@Gajus84
Copy link
Author

Gajus84 commented Aug 19, 2023

Hyprland (Wayland) with wl-clipboard (wl-copy and wl-paste). Watched by cliphist.

@sxyazi
Copy link
Owner

sxyazi commented Aug 19, 2023

Weird, I don't have a Wayland environment now.

Can you use #74 and execute the copy path operator, then do a cat ~/.local/state/yazi/yazi.log to paste the log here?

@Gajus84
Copy link
Author

Gajus84 commented Aug 19, 2023

Sure, here you go:

�[2m2023-08-19T16:46:25.853084Z�[0m �[32m INFO�[0m �[1;32mcore::external::clipboard�[0m�[32m: �[32mclipboard_set: "/home/gajus/Git/yazi/config"�[0m
�[2;3mat�[0m core/src/external/clipboard.rs:26

�[2m2023-08-19T16:46:25.853104Z�[0m �[32m INFO�[0m �[1;32mcore::external::clipboard�[0m�[32m: �[32mclipboard_set: trying "pbcopy" []�[0m
�[2;3mat�[0m core/src/external/clipboard.rs:36

�[2m2023-08-19T16:46:25.854604Z�[0m �[32m INFO�[0m �[1;32mcore::external::clipboard�[0m�[32m: �[32mclipboard_set: spawned Err(Os { code: 2, kind: NotFound, message: "No such file or directory" })�[0m
�[2;3mat�[0m core/src/external/clipboard.rs:44

Looks like wl-copy is not detected or not tried. Pbcopy is OSX, right?

@sxyazi
Copy link
Owner

sxyazi commented Aug 19, 2023

Thanks, I pushed the new code on that PR, please try it again

@Gajus84
Copy link
Author

Gajus84 commented Aug 19, 2023

With that yazi freezes when invoking the filename copy.

@sxyazi
Copy link
Owner

sxyazi commented Aug 19, 2023

Please try one last time. I bet it will work now! 🤣

@Gajus84
Copy link
Author

Gajus84 commented Aug 19, 2023

You have won this bet :D Thank you for the effort!

Another idea occurred to me while using it. The "display_name" feature from yazi.toml would also be interesting for the keymap, because the possibility to use own templates with the shell also produces very long lines in the help overview at times. With "display_name" you could "clean up" there.
But this is ofc of no big priority.

Thank you again for the great work.

@sxyazi
Copy link
Owner

sxyazi commented Aug 19, 2023

Thank you so much for testing! I will close this issue in favor of the feature requests, any ideas feel free to file a new issue!

@sxyazi sxyazi closed this as completed Aug 19, 2023
@maxzinkus
Copy link

Hi, apologies for reviving a closed issue and thank you again for this great project.

I'm encountering the same problem on macOS, where the copy command does not work with the system clipboard. I don't get an error, but the clipboard contents are not replaced. pbcopy and pbpaste work on my system.

@sxyazi
Copy link
Owner

sxyazi commented Aug 23, 2023

@maxzinkus Are you using the latest version from Git? it works on my macOS 🤔

@maxzinkus
Copy link

Ah! I'm not, I was on the homebrew version. I'll try HEAD but I assume it'll fix it :)

@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
@sxyazi
Copy link
Owner

sxyazi commented Jun 3, 2024

it would be nice to be able to assign mouse actions in keymap.toml as well

Hi, this feature has now been implemented by @qsdrqs in #1038! 🎉

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

No branches or pull requests

3 participants