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
merged 4 commits into from
Nov 2, 2024
Merged

Support "Copy Path" operation in WSL #2413

merged 4 commits into from
Nov 2, 2024

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
Collaborator

@cruessler could you test that on windows?

@cruessler
Copy link
Collaborator

@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
Collaborator

@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 gitui-org:master Nov 2, 2024
21 checks passed
@extrawurst
Copy link
Collaborator

@johnDeSilencio thank you for the contribution!

tmeijn pushed a commit to tmeijn/dotfiles that referenced this pull request Jan 28, 2025
This MR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [extrawurst/gitui](https://github.com/extrawurst/gitui) | minor | `v0.26.3` -> `v0.27.0` |

MR created with the help of [el-capitano/tools/renovate-bot](https://gitlab.com/el-capitano/tools/renovate-bot).

**Proposed changes to behavior should be submitted there as MRs.**

---

### Release Notes

<details>
<summary>extrawurst/gitui (extrawurst/gitui)</summary>

### [`v0.27.0`](https://github.com/extrawurst/gitui/releases/tag/v0.27.0)

[Compare Source](gitui-org/gitui@v0.26.3...v0.27.0)

**new: manage remotes**

![add-remote](assets/add-remote.png)

##### Breaking Changes

-   use default shell instead of bash on Unix-like OS \[[@&#8203;yerke](https://github.com/yerke)] ([#&#8203;2343](gitui-org/gitui#2343))

##### Added

-   add popups for viewing, adding, updating and removing remotes \[[@&#8203;robin-thoene](https://github.com/robin-thoene)] ([#&#8203;2172](gitui-org/gitui#2172))
-   support for `Copy Path` action in WSL \[[@&#8203;johnDeSilencio](https://github.com/johnDeSilencio)] ([#&#8203;2413](gitui-org/gitui#2413))
-   help popup scrollbar \[[@&#8203;wugeer](https://github.com/wugeer)] ([#&#8203;2388](gitui-org/gitui#2388))

##### Fixes

-   respect env vars like `GIT_CONFIG_GLOBAL` ([#&#8203;2298](gitui-org/gitui#2298))
-   Set `CREATE_NO_WINDOW` flag when executing Git hooks on Windows ([#&#8203;2371](gitui-org/gitui#2371))

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever MR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this MR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this MR, check this box

---

This MR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOS4xMzcuMSIsInVwZGF0ZWRJblZlciI6IjM5LjEzNy4xIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJSZW5vdmF0ZSBCb3QiXX0=-->
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