Copy and paste with wsmoused

Found at: zaibatsu.circumlunar.space:70/~solderpunk/phlog/copy-and-paste-with-wsmoused-on-openbsd.txt

Copy and paste with wsmoused on OpenBSD

My OpenBSD eeePC adventures[1] are continuing, and I'm continuing
to enjoy them.  I'm trying my hardest to keep my setup X11-free.
I've decided that I can live, for now, with slightly wonky UTF-8
characters (maybe I can work around the issue by finding a way
to configure the software generating them to output something
else instead).  But I quickly hit upon a much larger concern:
how do I copy and paste conveniently from the console?

I needn't have worried.  OpenBSD has *excellent* support for doing
this.  You don't need to install screen or tmux and depend on their
copy/paste mechanisms.  Everything you need is built right into the
base system, in the form of wsmoused(8).  This gives you a working
mouse and clipboard in the console.

To start wsmoused on bootup, do exactly what you'd expect to do on
a BSD system: put a line in your /etc/rc.conf.local file.  In my
case the line in question is:


The `-2` option to wsmoused tells it that the attached mouse has two
buttons, instead of 3, which is the default expectation.  As a result
of this, the paste function is assigned to the right button, instead
of the non-existant middle button.  This works nicely on the eeePC.

This gave me a working mouse on boot up, but the sensitivty of
it was insane - just the slightest movement of my finger on the
touchpad sent the cursor flying all the way across the screen.
Thankfully, this can be adjusted too.  wsconsctl(8), which has
exactly the same interface as the probably more familiar sysctl(8),
lets you tinker with various console-related options.  The relevant
one here is the mouse.tp.scaling variable.  Higher values result
in a more sensitive mouse.  I'm not exactly sure how this value
is defined, so I have no idea what the valid range of inputs is.
I think the default value on my system was somewhere around 0.1.
I ended up settling on a value of 0.02, i.e. about five times less
sensitive, as being nicely useable.  wsconsctl settings can be made
persistent by putting them in /etc/wsconsctl.conf, in perfect analogy
to sysctl's /etc/sysctl.conf (this kind of consistency is a beautiful
thing).  In my case, /etc/wsconsctl.conf contains only the one line:


So, this little aspect of life without X is 100% solved to my
satisfaction, and I'm a happy camper.