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

Fix get command on macOS #11

Merged
merged 17 commits into from
Nov 25, 2021
Merged

Fix get command on macOS #11

merged 17 commits into from
Nov 25, 2021

Conversation

kkga
Copy link
Owner

@kkga kkga commented Nov 24, 2021

fixes #10

Additionally, the get command:

  • now has an -R flag to print out raw Kakoune-quoted output
  • prints Kakoune's errors to stderr

kkga added 5 commits November 24, 2021 22:21
Prefix Kakoune's echo output with an arbitrary string so that the tmp file
is never empty even if the Kakoune's echo is an empty string.
No idea why, but fsnotify doesn't trigger the WRITE event on macOS
(as opposed to Linux) if the file content is empty.
@kkga
Copy link
Owner Author

kkga commented Nov 24, 2021

@TeddyDD Hey 👋

I had to make a few changes in order to fix the hanging issues in kak.Get() on macOS.

Problem I isolated, in short: the fsnotify doesn't trigger a WRITE event if the file content is empty after update, so I came up with an ugly solution to always prefix Kakoune's echo output with an arbitrary string that gets trimmed later (b2f27e9).

I also added a few more enhancements along the way:

  • the get command now has an -R flag to print out Kakoune-quoted output directly
  • if Kakoune errors-out, the error is written to stderr f9f5fb4

If you a have any desire and/or some free time, I'd appreciate if you could briefly test this to make sure all works :) Thanks!

@TeddyDD
Copy link
Contributor

TeddyDD commented Nov 24, 2021

Sure!

@TeddyDD
Copy link
Contributor

TeddyDD commented Nov 24, 2021

It seems to be working as expected on Linux.

@kkga
Copy link
Owner Author

kkga commented Nov 24, 2021

Awesome, glad it works for you.

I'm gonna test-drive this for a few more days before merging.

Thank you.

@TeddyDD
Copy link
Contributor

TeddyDD commented Nov 24, 2021

Okay, I'll be running this branch as well, let you know if something explodes.

@kkga kkga merged commit 7d2c8ae into main Nov 25, 2021
@kkga kkga deleted the fix-get-darwin branch November 25, 2021 11:53
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

Successfully merging this pull request may close these issues.

List command sometimes hangs on macOS
2 participants