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

COPY/PASTE doesn't work in CYGWIN #1596

Open
masinter opened this issue Mar 20, 2024 · 5 comments
Open

COPY/PASTE doesn't work in CYGWIN #1596

masinter opened this issue Mar 20, 2024 · 5 comments

Comments

@masinter
Copy link
Member

sh: line 1: xclip: command not found

it looks like you need to use getclip and putclip from the "cygwin-utils" suite of utilities from cygwin, and modify CLIPBOARD-PASTE-STREAM etc.
We need to establish a better way of determining host OS type?

@nbriggs
Copy link
Contributor

nbriggs commented Mar 20, 2024

I think we can modify the unix_getparm subr to provide more useful info for that.

@masinter
Copy link
Member Author

compared to adding "open URL in browser" and "copy to clipboard" "paste from clipboard" into Maiko?
under #ifdef for OSTYPE? it would make the result perhaps more portable?
wsl vs. windows vs. macos vs netbsd vs linux etc.

@nbriggs
Copy link
Contributor

nbriggs commented Mar 20, 2024

unix_getparm() takes a string, by convention an uppercase symbol, and returns something - it could take, for example, "BROWSE", "CLIPBOARD-COPY", "CLIPBOARD-PASTE" etc. Except that for "BROWSE" you have no idea which browser the user wants based on the operating system you're compiling for - many of the browsers are available on many different OSs - Safari, Chrome, Firefox, Opera, Edge, ... and we have no idea what preference the user may have set in the operating system, or if there is a generic invocation for the "open a URL" operation (e.g., in macOS open ...) -- so that's a run-time choice not a compile-time choice.

We currently have

  • "macOS"
  • "Cygwin"
  • "DragonFly BSD"
  • "FreeBSD"
  • "Linux"
  • "NetBSD"
  • "OpenBSD"
  • "AmigaOS 3"
  • "Solaris"
  • "Windows"
  • "Emscripten"

but, for example, Termux on Android looks like Linux as far as the compile goes, today, but doesn't behave like desktop Linux for things like copy/paste (as far as I know). We don't have Haiku in there yet, but that's easy. We don't distinguish between the Linux distros, or know whether the user is running w/ SDL, X11, Wayland, ... and what effect that has on the copy/paste/open operations.

Someone with the inclination could put together the list/matrix of possibilities.

@masinter
Copy link
Member Author

I see what you mean.
how about we set up some get-param driven site-init that set things up for the environments we use.

@nbriggs
Copy link
Contributor

nbriggs commented Mar 21, 2024

Yes. First step is deciding what info we need from get-param -- I think we currently have "DISPLAY" which will return "X", "SDL", [or perhaps once in the past, "BUFFERED", or "DIRECT"]. It's easy to include the OS that we detected during compilation, though as I mentioned that won't get all the cases -- but when we find things that don't work we can see what additional dimensions we need to differentiate among them.

I suggest returning the value of MAIKO_OS_NAME (from maiko/inc/maiko/platform.h) for get_parm("OSNAME"), and the value of MAIKO_ARCH_NAME (same source) for get_parm("ARCH") -- but I'm happy to take other suggestions.

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

2 participants