Skip to content

Conversation

bagage
Copy link

@bagage bagage commented Feb 28, 2020

Fixes #261

@bagage bagage force-pushed the master branch 2 times, most recently from fa4de18 to ace624e Compare March 2, 2020 16:16
@richrd
Copy link
Owner

richrd commented Mar 7, 2020

Since we already have some other dependencies like wcwidth I'm not against adding one for the clipboard. There's at least the libraries clipboard and pyperclip. Not sure which one we should use but pyperclip seems to be more popular.

@bagage
Copy link
Author

bagage commented Mar 13, 2020

  • I investigated the init_pair(0) issue, for now I don't see any solution apart from not executing that code on Windows (until upstream provide a fix for that, but it seems not very active at the moment).
  • For the ctrl+h issue, I see in suplemon that there are already some shortcuts with the same issue right now (^I ^J ^M ^Z). Maybe help should be bound to F2 instead? Or maybe we can have some specific key mapping for windows only? You tell me!
  • Clipboard handling is my next investigation :).

@richrd
Copy link
Owner

richrd commented Mar 21, 2020

  • I think for now we can just not run init_pair on Windows if it doesn't work, as long as it doesn't cause other issues.
  • Not quite sure what to do with ctrl+h. What happens currently when pressing backspace or ctrl+h? F2 can't be used because it's already bound to "reload file". If backspace works fine we could just remap help to some other key. Maybe we need a windows variant of the default keymap 🤔

Thanks again for the effort, I appreciate it! :)

@bagage
Copy link
Author

bagage commented Mar 21, 2020

backspace is the same as hitting ctrl+h, so instead of removing the latest character, it toggles the help. Hence the shortcut for help toggle should be something else, maybe only for windows (F3?F7?F8?). But since default keymapping is global, I'm not sure how this could be done.

Maybe it can be open as a separate issue as it does not block suplemon from working at least?

@richrd
Copy link
Owner

richrd commented Apr 23, 2020

Sorry for the late answer. Yeah, I guess it can be a separate issue, as long as backspace works for deleting characters. Help is also available by running the command help so it's not a huge issue. I do think we can have different default keymaps for different platforms as that's what Sublime seems to do.

@richrd
Copy link
Owner

richrd commented Apr 23, 2020

I took a closer look at clipboard and pyperclip and I think we should use pyperclip instead.
clipboard just wraps pyperclp and doesn't provide any additional functionality: https://github.com/terryyin/clipboard/blob/master/clipboard.py

@bagage
Copy link
Author

bagage commented Jul 6, 2020

Hi @richrd, sorry for the long answer! I finally managed to find some time to address the remaining issues.

  • replaced clipboard with pyperclip
  • ^H is now behaving as backspace instead of toggling help, even on Linux. Ideally if shortcuts could be per platform that would be needed only on Windows.
  • replaced resizeterm with resize_term to make it work on Windows, while not breaking Linux (I tested quickly)

Let me know if there is anything to rework/address :).

@bagage bagage changed the title WIP: Fix small issues on windows Fix small issues on windows Jul 6, 2020
@bagage
Copy link
Author

bagage commented Aug 6, 2020

Bump @richrd 🤙

@richrd
Copy link
Owner

richrd commented Aug 16, 2020

Hi and sorry for the late response! Summer has been busy :)
I'll test this out next week. The code looks good so I think it's pretty much ready for merging.
Thanks for your help :)

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.

Almost working on Windows :)

2 participants