[Discussion] How to copy and paste text
HalosGhost opened this issue · comments
So, obviously, yaft
runs without X. As a result, the typical selections that many linux users have come to expect (primary, secondary and tertiary/clipboard) are unavailable.
In searching what documentation I could find, I have yet to figure out how to easily copy and paste text since these selections are unavailable. Is there some method for doing this built in?
yaft does not have any copy/paste method.
Please use terminal multiplexer (GNU screen, tmux, etc..) with yaft.
That's too bad. Do you have any plans to offer support for something like gpm that might add basic mouse (and therefore, basic copy/pasting) functionality?
I'm not using pointer device with yaft. So I'm unmotivated to support mouse functionality.
If there are many people who's eager to use mouse, I might support it in future.
I created new branch, mouse-support via dc65361
How to build
$ git clone https://github.com/uobikiemukot/yaft
$ cd yaft
$ git checkout mouse-support
edit "mouse_path" in conf.h,
mouse device path is described in /proc/bus/input/devices
example)
- /dev/input/event4
- /dev/input/by-path/pci-0000:00:1a.0-usb-0:1.1:1.0-event-mouse
- /dev/input/by-id/usb-04b3_USB_Optical_Mouse-event-mouse
$ make
# gpasswd -a USER input
maybe need permission of "input" group
# /etc/init.d/gpm stop
or
# systemctl stop gpm
gpm mouse server conflicts yaft's mouse support
$ ./yaft
How to copy/paste
- copy area selection: hold mouse left button
- paste selected text: press mouse right button
Awesome start! There's an odd bug I am noticing though.
If I start yaft
after configuring the mouse_path
to point to /dev/input/event4
, and then I move the mouse over the top left-hand corner of the framebuffer, characters from the tty are revealed under the cursor as I move it around. See below for a screenshot:
cannot reproduce :(
- check mouse device is correct
- check following options (conf.h)
BACKGROUND_DRAW = false,
VT_CONTROL = true,
FORCE_TEXT_MODE = false,
- check environment variable YAFT is blank
Ahh, I have the FORCE_TEXT_MODE
since it solves witching from X and back. Is mouse functionality incompatible with that option?
I'm not sure because I don't face the strange bug. But these options and env variable cause some screen glitch.
What can I do to help test?
Please check whether gpm mouse server is runnning or not.
If gpm is running, stop it. The mouse functionality conflicts gpm.
Ahh! Yes, I had/have gpm running. I've stopped and disabled it. But, now, I see no cursor and cannot copy or paste text. I assume that's because I do not have the device correct. How can I detect what device I should use?
Please refer following command outputs:
$ dmesg | grep -i mouse
$ grep mouse /proc/bus/input/devices
and check device files in /dev/ipnut/by-{path,id}/*
$ ls -l /dev/input/by-path/* | grep event-mouse
$ ls -l /dev/input/by-id/* | grep event-mouse
Simple test program is found here (https://gist.github.com/uobikiemukot/457338b890e96babf60b)
$ gcc linux_input.c -o linux_input
$ ./linux_input /dev/input/event5
(Ctrl-C for quit)
Okay, so, everything I see in there point to /dev/input/event13
, /dev/input/event14
, /dev/input/mouse0
and /dev/input/mouse1
. However, I have rebuilt yaft
with each one, and I still have not gotten a cursor/copy/paste.
Running the test program gives no output at all for event13
and mouse1
. For the other two, the status line appears in the top-left, but nothing happens when I move the mouse or click.
I don't know why test program fails.
Any idea what I should try next? 😄
Sorry, I have no idea.
All right, I will try to experiment with it tomorrow and see if I can figure out what may be the issue.
Sorry for the truly incredible delay on this. I will have some free time coming up and I am going to again investigate if I can reasonably switch a lot of my workflow out of X which means turning to yaft. Fingers crossed!
Doesn't gpm have a mouse API? It would be much easier to use it instead of doing the mouse interactions yourself.
BTW, I'd suggest just providing mouse escape sequences and leave copy-paste to the terminal multiplexer.
@uobikiemukot, this is now fully functional on at least one of my machines (though this machine does not have X installed yet). I think it's definitely past due to merge this branch, and if the bug with switching between X and yaft reappears, to deal with that later.