andcli icon indicating copy to clipboard operation
andcli copied to clipboard

Fix xclip not working on xorg and add Windows support

Open elliotwutingfeng opened this issue 1 year ago • 0 comments

Proposed changes

  • The clipboard copy feature doesn't work on my Linux xorg machine unless I add cmd += " -selection clipboard".

    System details

    OS: Manjaro Linux amd64 Desktop Environment: GNOME xorg Kernel: 6.6.10-1-MANJARO xclip version: xclip-0.13-4

    Not sure if this is a distro-specific issue.

  • If none of the 3 UNIX clipboard programs ("xclip", "wl-copy", "pbcopy") are present, then we fallback to this cross-platform clipboard package which works on Windows, and if that also fails to initialize, then the copy function is disabled.

    image Working clipboard copy on Windows 10 amd64 PowerShell

  • Bumped GitHub Actions as Node 16 is deprecated, and Go 1.22 has been released.

Additional information about Go clipboard

It works out of the box on Windows with no dependencies or compilation tweaks.

Dependency

    macOS: require Cgo, no dependency
    Linux: require X11 dev package. For instance, install libx11-dev or xorg-dev or libX11-devel to access X window system.
    Windows: no Cgo, no dependency
    iOS/Android: collaborate with [gomobile](https://golang.org/x/mobile)

Known issues

  • Password stdin input fails on MINGW64 for Windows.
  • json.Unmarshal fails on 32-bit systems; can be rectified by switching to int64 type.
  • Tick icon font missing ? on Windows 10 when copied to clipboard.

elliotwutingfeng avatar Feb 06 '24 20:02 elliotwutingfeng