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

Support "Copy Path" operation in WSL #2413

Merged

Conversation

johnDeSilencio
Copy link
Contributor

@johnDeSilencio johnDeSilencio commented Oct 31, 2024

This PR adds support for the "Copy Path" operation in the "Files" tab when running in WSL.

For those like myself who are accessing WSL from a terminal, there is no X server, so xclip won't work. However, my Ubuntu WSL image at work still has xclip installed, which gitui detects and uses, causing gitui to freeze. I have to kill gitui at that point.

This PR checks if we are running in WSL by examining the description of the kernel in the OS release file, /proc/sys/kernel/osrelease. If gitui is running in WSL, we copy the path to the Windows clipboard using the clip.exe utility.

I followed the checklist:

  • I added unittests (I didn't see any other unit tests in clipboard.rs, so I didn't try to add any here)
  • I ran make check without errors (proof: output.txt)
  • I tested the overall application (see below)
  • I added an appropriate item to the changelog (put in the Added subsection under Unreleased)

gitui

@extrawurst extrawurst added help wanted Extra attention is needed windows labels Oct 31, 2024
@extrawurst
Copy link
Owner

@cruessler could you test that on windows?

@cruessler
Copy link
Contributor

@cruessler could you test that on windows?

I only have Linux and Mac machines available, unfortunately.

@Concelare
Copy link
Contributor

I can test it tonight if you want @extrawurst

@extrawurst
Copy link
Owner

@Concelare that would be awesome

@johnDeSilencio
Copy link
Contributor Author

@extrawurst Sorry! Meant to mention that I was going to test it when I got back into work today and had access to my WSL instance. Looks like everything is working as expected! :)

gitui_wsl

@Concelare
Copy link
Contributor

Concelare commented Oct 31, 2024

I tested this and it worked as expected,I didn't have the most time this evening to test it in every way but I had no issues using it as intended. 👍

Tested on Windows 10 WSL 2 Ubuntu 24.04, Used it on few different git repos of different size with no issues

@johnDeSilencio
Copy link
Contributor Author

I tested this and it worked as expected,I didn't have the most time this evening to test it in every way but I had no issues using it as intended. 👍

Tested on Windows 10 WSL 2 Ubuntu 24.04, Used it on few different git repos of different size with no issues

Thank you, @Concelare!

@extrawurst extrawurst merged commit 94924db into extrawurst:master Nov 2, 2024
21 checks passed
@extrawurst
Copy link
Owner

@johnDeSilencio thank you for the contribution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed windows
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants