Commit Graph

1381 Commits

Author SHA1 Message Date
Jakub Leszczak
045a0fab4f Fix selection: selscroll 2020-05-12 15:38:17 +02:00
Jakub Leszczak
9c30066e73 Fix selection: ignore ATTR_WRAP when rectangular selection in getsel 2020-05-12 15:38:02 +02:00
Jakub Leszczak
8304d4f059 Fix selection: selclear in tputc 2020-05-12 15:37:59 +02:00
mackarelfish
4edc7282ab Added ligatures patch 2020-05-12 03:46:52 +07:00
Hiltjo Posthuma
914fb825df code-style: add fallthrough comment
Patch by Steve Ward, thanks.
2020-05-09 14:43:31 +02:00
Hiltjo Posthuma
cde480c693 optimize column width calculation and utf-8 encode for ASCII
In particular on OpenBSD and on glibc wcwidth() is quite expensive.
On musl there is little difference.
2020-05-09 14:11:25 +02:00
Hiltjo Posthuma
8211e36d28 fix for incorrect (partial) written sequences when libc wcwidth() == -1
Fix an issue with incorrect (partial) written sequences when libc wcwidth() ==
-1. The sequence is updated to on wcwidth(u) == -1:

	c = "\357\277\275"

but len isn't.

A way to reproduce in practise:

* st -o dump.txt
* In the terminal: printf '\xcd\xb8'
- This is codepoint 888, on OpenBSD it reports wcwidth() == -1.
- Quit the terminal.
- Look in dump.txt (partial written sequence of "UTF_INVALID").

This was introduced in:

"	commit 11625c7166
	Author: czarkoff@gmail.com <czarkoff@gmail.com>
	Date:   Tue Oct 28 12:55:28 2014 +0100

	    Replace character with U+FFFD if wcwidth() is -1

	    Helpful when new Unicode codepoints are not recognized by libc."

Change:

Remove setting the sequence. If this happens to break something, another
solution could be setting len = 3 for the sequence.
2020-05-09 14:07:52 +02:00
Hiltjo Posthuma
87545c612e tiny code-style and typo-fix in comment 2020-05-09 14:05:04 +02:00
Avi Halachmi (:avih)
1d59091065 auto-sync: draw on idle to avoid flicker/tearing
st could easily tear/flicker with animation or other unattended
output. This commit eliminates most of the tear/flicker.

Before this commit, the display timing had two "modes":

- Interactively, st was waiting fixed `1000/xfps` ms after forwarding
  the kb/mouse event to the application and before drawing.

- Unattended, and specifically with animations, the draw frequency was
  throttled to `actionfps`. Animation at a higher rate would throttle
  and likely tear, and at lower rates it was tearing big frames
  (specifically, when one `read` didn't get a full "frame").

The interactive behavior was decent, but it was impossible to get good
unattended-draw behavior even with carefully chosen configuration.

This commit changes the behavior such that it draws on idle instead of
using fixed latency/frequency. This means that it tries to draw only
when it's very likely that the application has completed its output
(or after some duration without idle), so it mostly succeeds to avoid
tear, flicker, and partial drawing.

The config values minlatency/maxlatency replace xfps/actionfps and
define the range which the algorithm is allowed to wait from the
initial draw-trigger until the actual draw. The range enables the
flexibility to choose when to draw - when least likely to flicker.

It also unifies the interactive and unattended behavior and config
values, which makes the code simpler as well - without sacrificing
latency during interactive use, because typically interactively idle
arrives very quickly, so the wait is typically minlatency.

While it only slighly improves interactive behavior, for animations
and other unattended-drawing it improves greatly, as it effectively
adapts to any [animation] output rate without tearing, throttling,
redundant drawing, or unnecessary delays (sounds impossible, but it
works).
2020-05-09 13:53:50 +02:00
Luke Smith
fdf3989005
tmux fix, including compile-time errors 2020-05-06 14:01:46 -04:00
Luke Smith
4f44d2d13f
auto-sync patch 2020-05-06 13:58:09 -04:00
Luke Smith
b35e4f5727
boxdraw added 2020-05-05 13:55:37 -04:00
Luke Smith
b43e574fa6
cleanup 2020-05-05 13:52:44 -04:00
Jan Klemkow
d6ea0a1a61 replace exit(3) by _exit(2) in signal handler sigchld()
exit(3) is not async-signal-safe but, _exit(2) is.
This change prevents st to crash and dump core.
2020-04-30 01:21:21 +02:00
Luke Smith
7e01028f86
Merge branch 'pasbi-master' 2020-04-28 19:11:52 -04:00
Luke Smith
b7b9c54a10
less opaque to compensate for darker bg 2020-04-28 19:09:15 -04:00
Luke Smith
f2faf93fab
regex update 2020-04-28 18:48:43 -04:00
Luke Smith
ce7ef62c11
fix with upstream 2020-04-28 18:46:21 -04:00
Hiltjo Posthuma
43a395ae91 bump version to 0.8.3 2020-04-27 13:56:25 +02:00
Ivan Tham
72e3f6c7c0 Update XIM cursor position only if changed
Updating XIM cursor position is expensive, so only update it when cursor
position changed.
2020-04-19 19:39:48 +02:00
Luke Smith
3f44e88d6e
no longer embed dmenu to prevent error if dmenu
has no alpha patch
2020-04-16 14:48:52 -04:00
Luke Smith
1d1fefcd7b
Merge branch 'master' of github.com:LukeSmithxyz/st 2020-04-15 16:43:26 -04:00
Luke Smith
baa9fa076a
following links now separate script
this avoids the effects of swallow in dwm

it also will not produce dmenu without found urls
2020-04-15 16:43:14 -04:00
Luke Smith
d9f3fd8a16
cleanup 2020-04-15 16:42:19 -04:00
Hiltjo Posthuma
33a9a45664 just remove the EOF message 2020-04-11 15:45:06 +02:00
Roberto E. Vargas Caballero
771bc401f7 Add st-mono terminfo entry
This entry is intended for monocolor display and it is very
helpful for color haters.
2020-04-11 15:23:23 +02:00
Hiltjo Posthuma
d66bd405c0 config.def.h: add a comment for the scroll variable 2020-04-11 15:23:23 +02:00
Hiltjo Posthuma
e997303502 Fix small typos 2020-04-11 15:23:23 +02:00
Quentin Rameau
c1145268f6 Launch scroll program with the default shell 2020-04-11 15:23:23 +02:00
Roberto E. Vargas Caballero
0b73612c0d Update FAQ with the last modifications 2020-04-11 15:23:23 +02:00
Roberto E. Vargas Caballero
019449a7e6 Add terminfo entries for backspace mode
St used to use backspace as BS until the commit 230d0c8, but due
to general lack of knowledge of lusers, we moved to the most common
configuration in linux to avoid answering the same question 3 times
per month. With the most common configuration we have a backspace
that returns a DEL, and we have a Delete key that doesn't return a
DEL character neither a BS.

When dealing with devices connected using a serial line (or even
with Plan9) it is more common Backspace as BS and Delete as DEL. For
this reason, st is not always the best tool when you talk with a
serial device.

This patch adds new terminfo entries for Backspace as BS and Delete
as DEL. A patch for confg.h is also added, to make easier switch
between both configurations.
2020-04-11 15:23:23 +02:00
Roberto E. Vargas Caballero
fbae700a3f Fix style issue 2020-04-11 15:23:23 +02:00
Roberto E. Vargas Caballero
e52319cc7d ttyread: test for EOF while reading tty
When a read operation returns 0 then it means that we arrived to the end of the
file, and new reads will return 0 unless you do some other operation such as
lseek(). This case happens with USB-232 adapters when they are unplugged.
2020-04-11 15:23:23 +02:00
Roberto E. Vargas Caballero
21e0d6e8b8 Add support for scroll(1)
Scroll is a program that stores all the lines of its child and be used in st as
a way of implementing scrollback.

This solution is much better than implementing the scrollback in st itself
because having a different program allows to use it in any other program
without doing modifications to those programs.
2020-04-11 15:23:20 +02:00
Luke Smith
1832b84873
Merge pull request #190 from eGredius/patch-1
Get rid of NUL character in PS1
2020-04-10 12:14:25 -04:00
GregW
93dcba59de
Get rid of NUL character in PS1
The first grep in the original script will return "binary file matches" if there are NUL characters in PS1, e.g, emojis.
The added line gets rid of NUL characters.
2020-04-10 11:59:55 -04:00
Hiltjo Posthuma
5703aa0390 make argv0 not static, fixes a warning with tcc
Reported by Aajonus, thanks!
2020-04-10 12:12:43 +02:00
Avi Halachmi (:avih)
28ad288399 mouseshortcuts: fix custom modifier on release
This line didn't work at mshortcuts at config.h:

  /*  mask       button   function  arg       release */
    { ShiftMask, Button2, selpaste, {.i = 0}, 1 },

and now it does work.

The issue was that XButtonEvent.state is "the logical state ... just prior
to the event", which means that on release the state has the Button2Mask
bit set because button2 was down just before it was released.

The issue didn't manifest with the default shift + middle-click on release
(to override mouse mode) because its specified modifier is XK_ANY_MOD, at
which case match(...) ignores any specific bits and simply returns true.

The issue also doesn't manifest on press, because prior to the event
Button<N> was not down and its mask bit is not set.

Fix by filtering out the mask of the button which we're currently matching.

We could have said "well, that's how button events behave, you should
use ShiftMask|Button2Mask for release", but this both not obvious to
figure out, and specifically here always filtering does not prevent
configuring any useful modifiers combination. So it's a win-win.
2020-04-02 14:41:03 +02:00
Luke Smith
689add8aad
middle click pastes selection again 2020-04-01 09:40:53 -04:00
Luke Smith
e7db668a0a
Merge branch 'master' of github.com:LukeSmithxyz/st 2020-04-01 09:28:28 -04:00
Luke Smith
e248ef8c33
Merge pull request #183 from Fogapod/master
Do not copy text to clipboard after selecting
2020-04-01 09:24:32 -04:00
Eugene
7917ec930a Do not copy text to clipboard after selecting
This behaviour was introduced in 6833411400
Resolves: #177
2020-04-01 13:37:57 +03:00
georg3tom
9ce69b377a Changed flag to -z 2020-03-27 22:36:12 +05:30
georg3tom
26b57c7300 FIX bug in error and copy link
Apparently read only reads a single line so only one url was
    fed to dmenu.
2020-03-27 21:29:53 +05:30
georg3tom
8ba5325adb dmenu prompt is only shown if there's atleast one link 2020-03-25 15:06:03 +05:30
Luke Smith
72c555f605
Merge branch 'master' of github.com:LukeSmithxyz/st 2020-03-20 08:40:22 -04:00
Luke Smith
ec72bbe23e
adding @ to regex 2020-03-11 09:59:02 -04:00
Luke Smith
6725a2fde0
Merge pull request #85 from jbenden/xim_interval
Add interval timer to XIM spot updates
2020-03-11 09:43:27 -04:00
Ivan Tham
51e19ea11d Remove explicit XNFocusWindow
XCreateIC ICValues default XNFocusWindow to XNClientWindow if not
specified, it can be omitted since it is the same.

From the documentation
https://www.x.org/releases/current/doc/libX11/libX11/libX11.html

> Focus Window
>
> The XNFocusWindow argument specifies the focus window. The primary
> purpose of the XNFocusWindow is to identify the window that will receive
> the key event when input is composed.
>
> When this XIC value is left unspecified, the input method will use the
> client window as the default focus window.
2020-02-19 00:46:20 +01:00
Luke Smith
e2a59d5521
backend color number changes 2020-02-09 15:48:07 -05:00