ttywrite was assuming that if it could not write then it could
read, but this is not necessarily true, there are some situations
where you cannot read or write. The correct behaviour is to detect
if you can read or/and write.
Before the fix the cursor wouldn't obey if it's in a selection. If it is
inside it will now change to the reverse. This patch also adds that the
defaultcs will be reversed for the manually drawn cursors.
Before this patch, when pasting over BUFSIZE (8192 bytes here), st would
do the following:
\e[200~...8192 bytes...\e[201~\e[200~...remaining bytes...\e[201~
With this patch, the start marker is only sent when the offset is 0 (at
the beginning of selnotify) and the end marker is only sent when the
remaining bytes to read are 0 (at the end).
For short pastes, both conditions are true in the same iteration.
For long pastes, it removes the extra markers in the middle, keeping the
\e[200~...8192 bytes......remaining bytes...\e[201~
Signed-off-by: Christoph Lohmann <email@example.com>
gcc would warn about an unused result. We know it is 0 and dup()
can't fail in these circumstances, as we closed fd0 previously.
Using dup2() to do the same saves one line and shuts gcc up, bringing
us a clean build back.
When a line has no any character linelen is 0, so last = &term.line[y][MIN(lastx, linelen-1)]
generated a pointer to the end of the previous line. The best thing we can do in this case
is to add a newline, because we don't have a glyph to print (and consult its state of
A little fix in xwrite().
>From 3727d2e3344b57128ab51c7839795204f1f839ff Mon Sep 17 00:00:00 2001
From: Quentin Rameau <firstname.lastname@example.org>
Date: Fri, 24 Jul 2015 11:40:46 +0200
Subject: [PATCH] Fix type for write(2) return variable.
The allocated lengh of s fits into an integer so we can safely use