ahmednooor / lino

A command line text editor with notepad like key bindings.
MIT License
36 stars 2 forks source link

`Ctrl + C` is not updating the clipboard. #6

Open calandoa opened 3 years ago

calandoa commented 3 years ago

I select with shift + arrows some words, I press Ctrl + C, I can see the Copied. message in the status bar, but the clipboard (primay or clipboard) is not updated. Same with Ctrl + X : Cut. is shown, the selection is deleted, but the clipbord is not updated.

I am using Ubuntu 18.04.5 LTS with XFCE 4.12.

I have these settings :

LANG=en_US.UTF-8
LANGUAGE=en_US:
> setxkbmap -query
rules:      evdev
model:      pc105
layout:     us
variant:    altgr-intl
calandoa commented 3 years ago

Also, I am using xterm:

TERM=xterm
XTERM_LOCALE=en_US.UTF-8
XTERM_SHELL=/bin/zsh
XTERM_VERSION='XTerm(330)'
ahmednooor commented 3 years ago

@calandoa I am using copypasta lib for accessing OS clipboard. As of now it only supports wayland and x11 clipboards (see: https://docs.rs/copypasta/0.7.1/copypasta/). I am not much of a deep systems person so pardon me if I am wrong but maybe it is because xfce under the hood, doesn't use x11 or wayland clipboard and instead has its own implementation? Can you conform? Thanks.

calandoa commented 3 years ago

XFCE use the standard X11 clipboard system. Unfortunately XFCE is the only manager I have on my system so I cannot try with another one. I also tried with gnome-terminal and I get the same problem.

ahmednooor commented 3 years ago

Seems like a missing library. I am using copypasta for clipboard access, this lib is a fork of rust-clipboard which requires the xorg-dev lib to be installed.

Please check the links below for further. [WARNING]: Steps mentioned in the links below, might break your OS. So please proceed with caution.

https://github.com/ahmednooor/lino/tree/main#build

copypasta

rust-clipboard prerequisites

I have also created a separate branch with the name issue-6 in which I have commented out accessing the OS clipboard manager. Please clone and run that and share the findings.

Thanks.

calandoa commented 3 years ago

So I installed xorg-dev, I checked out issue-6, I built and ran with cargo run... and I can copy and paste stuff internally. So the culprit seem to be the library again.

ahmednooor commented 3 years ago

Thank you. Try to build and run the main branch as well and see if installing xorg-dev fixed it or not.

calandoa commented 3 years ago

Well, thanks to you for your work!

After installing xorg-dev and switching back to main, the copy/paste is working fine at the system level.

But afterwards, I tried to desinstall xorg-dev, clean, reboot and rebuild all to be sure... and it is still working!

I searched a bit and finally the difference is just building lino from the source (git clone) is working, but installing it directly with cargo install breaks the copy/paste. I did not investigate further, so maybe this is finally cargo the culprit.

ahmednooor commented 3 years ago

Thank you. That is quite strange. I am keeping this issue open for now.