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

[pbpaste workaround on wsl2] #269

Open
theAfricanQuant opened this issue Mar 17, 2024 · 10 comments
Open

[pbpaste workaround on wsl2] #269

theAfricanQuant opened this issue Mar 17, 2024 · 10 comments

Comments

@theAfricanQuant
Copy link

theAfricanQuant commented Mar 17, 2024

...But i found a workaround that could help

win32yank.exe -o accesses the clipboard of windows to extract teh info stored there

complete code sample that worked for me: win32yank.exe -o | fabric --pattern extract_main_idea

@theAfricanQuant theAfricanQuant changed the title [pbpaste on WSL2] I couldn't use pbpaste on wsl... [pbpaste workaround on wsl2] Mar 17, 2024
@foxbg
Copy link

foxbg commented Mar 18, 2024

If you are using powershell Get-Clipboard is also good replacement.
Source: https://labs.hbcom.info/posts/fabric/#additional-tips

@theNetworkChuck
Copy link

Using xsel covers it. Put this into your bashrc config

alias pbcopy='xsel --clipboard --input'
alias pbpaste='xsel --clipboard --output'

@theAfricanQuant
Copy link
Author

I had tried the two above on wsl2...didn't work for me maybe I didn't understand how to use them

@theNetworkChuck
Copy link

theNetworkChuck commented Mar 20, 2024 via email

@xhorntail
Copy link

I had tried the two above on wsl2...didn't work for me maybe I didn't understand how to use them

The top two responses will only work outside of WSL.
Go with the @theNetworkChuck solution.

@omoralesg
Copy link

I am able to copy and paste my files within the command line in powershell or access the clipboard but when I run the paste with the | fabric -pattern custom_1 it says pattern not found . Any ideas what am I doing wrong ? Thanks

@foxbg
Copy link

foxbg commented Mar 27, 2024

Is your pattern included when you run with --list
If custom look at https://github.com/danielmiessler/fabric?tab=readme-ov-file#custom-patterns

@omoralesg
Copy link

Is your pattern included when you run with --list If custom look at https://github.com/danielmiessler/fabric?tab=readme-ov-file#custom-patterns

no, its not included in the --list . When I put the command Get-Clipboard | fabric --pattern custom1 seems to run it but then I get the message, pattern not found

@theAfricanQuant
Copy link
Author

theAfricanQuant commented Mar 27, 2024

Using xsel covers it. Put this into your bashrc config

alias pbcopy='xsel --clipboard --input' alias pbpaste='xsel --clipboard --output'

I decide to retry this method today but with the tweak that has been working for me and it worked. I use /.zshrc in my case.

alias pbcopy='win32yank.exe -i'
alias pbpaste='win32yank.exe -o'

Thanks @theNetworkChuck for your shortcuts.

win32yank.exe is a tool used in Windows Subsystem for Linux (WSL). WSL allows you to run a Linux environment directly on Windows. The win32yank.exe tool is used for accessing the Windows clipboard from within the WSL environment. The -o flag stands for "output", which means this command will output the contents of the Windows clipboard.

So, when you set alias pbpaste='win32yank.exe -o' in a shell running in WSL, you are essentially creating a way to use the pbpaste command familiar to macOS users to access the Windows clipboard within the Linux environment of WSL.

@foxbg
Copy link

foxbg commented Mar 27, 2024

Is your pattern included when you run with --list If custom look at https://github.com/danielmiessler/fabric?tab=readme-ov-file#custom-patterns

no, its not included in the --list . When I put the command Get-Clipboard | fabric --pattern custom1 seems to run it but then I get the message, pattern not found

Then it looks you want to use a custom pattern. In that case you need to review information in the link. (Open new issue as the problem you face does not seem to be related to the current one)

@ryankupk ryankupk mentioned this issue Mar 30, 2024
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

5 participants