Commit Graph

1326 Commits

Author SHA1 Message Date
hazen2215 0214b3df3d config.h: add copyout 2023-08-13 00:31:31 +09:00
hazen2215 f4679baf5c config.h: add urlview; update keybinds 2023-08-02 23:21:32 +09:00
hazen2215 473dc914c0 config.mk: reset CFLAGS 2023-08-02 23:21:32 +09:00
hazen2215 193a9f317d st.c: avoid VLA 2023-08-02 23:21:32 +09:00
hazen2215 089de203f6 Update colors 2023-08-02 23:21:32 +09:00
hazen2215 5e98652695 font:monospace 2023-08-02 23:21:32 +09:00
hazen2215 7ff9ca7f97 forward/back key to scroll 2023-08-02 23:21:32 +09:00
hazen2215 c9d231cf1c apply patches 2023-08-02 23:21:32 +09:00
hazen2215 cfea6b7bc5 change the directory structure 2023-08-02 23:21:32 +09:00
Ashish Kumar Yadav 1237b32777 Upstream update 3a6d6d740110e6ee1b092d05ad746244eedabe4b
Author: Shi Tian <shitian@cock.li>
Date:   Sun Jun 25 05:38:33 2023 +0000

    Fix for wide character being incorrectly cleared on MODE_INSERT

    Under insert mode, when inserting a normal character in front of
    a wide character, the affected region is shifted to the right by
    one cell. However, the empty cell is reset as if being a part of a
    wide character, causing the following cell being mishandled as a
    dummy cell.
    To reproduce the bug:
            printf '\033[4h' # set MODE_INSERT
            printf 妳好
            printf '\033[4D'
            printf 'x'
            printf '\033[4l\n'
2023-07-06 04:57:05 +05:30
Ashish Kumar Yadav e4964975fa Fixed packaging 2023-06-13 04:33:29 +05:30
Ashish Kumar Yadav 6640a36645 Complete 8becd85927 2023-06-13 03:47:14 +05:30
Ashish Kumar Yadav af12faf1f4 Upstream update 211964d56ee00a7d46e251cbc150afb79138ae37
Author: Hiltjo Posthuma <hiltjo@codemadness.org>
Date:   Tue Feb 7 20:00:59 2023 +0100

    ignore C1 control characters in UTF-8 mode

    Ignore processing and printing C1 control characters in UTF-8 mode.
    These are in the range: 0x80 - 0x9f.

    By default in st the mode is set to UTF-8.

    This matches more the behaviour of xterm with the options -u8 or +u8 also.
    Also see the xterm resource "allowC1Printable".

    Let me know if this breaks something, in most cases I don't think so.

    As usual a very good reference is:
    https://invisible-island.net/xterm/ctlseqs/ctlseqs.html
2023-06-02 04:10:29 +05:30
Ashish Kumar Yadav a6b2a0a2ac Upstream update f17abd25b376c292f783062ecf821453eaa9cc4c
Author: Adam Price <komidore64@gmail.com>
Date:   Tue Feb 7 19:54:29 2023 +0100

    Add support for DSR response "OK" escape sequence

    "VT100 defines an escape sequence [1] called Device Status Report (DSR). When
    the DSR sequence received is `csi 5n`, an "OK" response `csi 0n` is returned.
    This patch adds that "OK" response.

    I encountered this missing sequence when I noticed that fzf [2] would clobber
    my prompt whenever completing a find.

    To test that ST doesn't currently respond to `csi 5n`, use fzf's shell
    extension in ST's repo to complete the path for a file.

        my-fancy-prompt $ vim **<tab>
        <select a file>
        st.c

    Select a file with <enter>, and notice that fzf clobbers some or all of your
    prompt.

    After applying this patch, do the same test as above and notice that fzf has no
    longer clobbered your prompt by placing the file name in the correct position
    in your command.

        my-fancy-prompt $ vim **<tab>
        <select a file>
        my-fancy prompt $ vim st.c

    Thank you for considering my first patch submission.

    [1] https://www.xfree86.org/current/ctlseqs.html#VT100%20Mode
    [2] https://github.com/junegunn/fzf
    "

    Patch slightly adapted with input from the mailinglist,
2023-06-02 04:07:54 +05:30
Ashish Kumar Yadav f7ebd22960 Upstream update 7e8050cc621f27002eaf1be8114dee2497beff91
Author: Hiltjo Posthuma <hiltjo@codemadness.org>
Date:   Sun Feb 5 13:29:35 2023 +0100

    Fixed OSC color reset without parameter->resets all colors

    Adapted from (garbled) patch by wim <wim@thinkerwim.org>

    Additional notes: it should reset all the colors using xloadcols().
    To reproduce: set a different (theme) color using some escape code,
    then reset it:

            printf '\x1b]104\x07'
2023-06-02 04:02:25 +05:30
Ashish Kumar Yadav 8b8a6d23b4 Upstream update e5e959835b195c023d1f685ef4dbbcfc3b5120b2
Author: Hiltjo Posthuma <hiltjo@codemadness.org>
Date:   Tue Oct 25 17:11:11 2022 +0200

    fix buffer overflow when handling long composed input

    To reproduce the issue:

    "
    If you already have the multi-key enabled on your system, then add this line
    to your ~/.XCompose file:

    [...]
    <question> <T> <E> <S> <T> <question> :
    "1234567890123456789012345678901234567890123456789012345678901234567890"
    "

    Reported by and an initial patch by Andy Gozas <andy@gozas.me>, thanks!

    Adapted the patch, for now st (like dmenu) handles a fixed amount of composed
    characters, or otherwise ignores it. This is done for simplicity sake.
2022-11-08 10:49:30 +05:30
Ashish Kumar Yadav 916e612b6e Bump version to 0.9 2022-10-14 15:23:10 +05:30
Ashish Kumar Yadav 7f970528b6 Revert back HISTSIZE to 2000; increases memory consumption 2022-10-05 05:51:33 +05:30
Ashish Kumar Yadav 0106a14a5f Increased HISTSIZE to 10000 2022-09-22 09:38:30 +05:30
Ashish Kumar Yadav 08e88a7a81 Upstream update 00085199039ee63acc7b1ecb7e3774a9c3552b2a
Author: Hiltjo Posthuma <hiltjo@codemadness.org>
Date:   Fri Sep 16 23:07:09 2022 +0200

    FAQ: document the color emojis crash issue which affected some systems is fixed

    It is fixed in libXft 2.3.6:

    https://gitlab.freedesktop.org/xorg/lib/libxft/-/blob/libXft-2.3.5/NEWS
2022-09-18 02:29:29 +05:30
Ashish Kumar Yadav eb96c5071f Now st-plumber also opens directories 2022-07-14 04:05:32 +05:30
Ashish Kumar Yadav d5e92fa6fc Upstream update cd0773cee9bad694dc9a6b1355a32bbe61abadff
Author: Hiltjo Posthuma <hiltjo@codemadness.org>
Date:   Sun May 1 18:38:40 2022 +0200

    Makefile: add manual path for OpenBSD
2022-05-03 15:57:40 +05:30
Ashish Kumar Yadav 492baaa71e Upstream update 8629d9a1da72cc18568a8f146307b0e939b77ebf
Author: NRK <nrk@disroot.org>
Date:   Fri Jan 7 23:21:04 2022 +0600

    code-golfing: cleanup osc color related code

    * adds missing function prototype
    * move xgetcolor() prototype to win.h (that's where all the other x.c
      func prototype seems to be declared at)
    * check for snprintf error/truncation
    * reduces code duplication for osc 10/11/12
    * unify osc_color_response() and osc4_color_response() into a single function

    the latter two was suggested by Quentin Rameau in his patch review on
    the hackers list.
2022-04-21 21:49:03 +05:30
Ashish Kumar Yadav a9a0f9b66c Upstream update ef0551932fb162f907b40185d2f48c3b497708ee
Author: NRK <nrk@disroot.org>
    Date:   Fri Mar 18 17:03:34 2022 +0600

    base64_digits: reduce scope, implicit zero, +1 size

    the array is not accessed outside of base64dec() so it makes sense to
    limit it's scope to the related function. the static-storage duration of
    the array is kept intact.

    this also removes unnecessary explicit zeroing from the start and end of
    the array. anything that wasn't explicitly zero-ed will now be
    implicitly zero-ed instead.

    the validity of the new array can be easily confirmed via running this
    trivial loop:

            for (int i = 0; i < 255; ++i)
                    assert(base64_digits[i] == base64_digits_old[i]);

    lastly, as pointed out by Roberto, the array needs to have 256 elements
    in order to able access it as any unsigned char as an index; the
    previous array had 255.

    however, this array will only be accessed at indexes which are
    isprint() || '=' (see `base64dec_getc()`), so reducing the size of the
    array to the highest printable ascii char (127 AFAIK) + 1 might also be
    a valid strategy.
2022-03-23 02:17:58 +05:30
Ashish Kumar Yadav cf784c1db7 Upstream update af3bb68add1c40d19d0dee382009e21b0870a38f
Author: NRK <nrk@disroot.org>
    Date:   Fri Mar 18 16:20:54 2022 +0600

    avoid potential UB when using isprint()

    all the ctype.h functions' argument must be representable as an unsigned
    char or as EOF, otherwise the behavior is undefined.
2022-03-23 02:15:12 +05:30
Ashish Kumar Yadav 1154978c55 Upstream update 2aefa348baf4b702fdce98eb105bcba175d8283f
Author: Zacchary Dempsey-Plante <zacc@ztdp.ca>
    Date:   Sun Mar 13 10:44:08 2022 +0100

    make underlines and strikethroughs respect `chscale`
2022-03-23 02:12:37 +05:30
Ashish Kumar Yadav 3df2c4893e Upstream update e823e2308f2a99023032a3966ebb7036a31d305f
Delay redrawals on palette changes

Build on auto-sync and only mark window dirty on palette changes and let
the event handler do the actual draw.
2022-02-27 02:14:48 +05:30
Ashish Kumar Yadav b259114879 Upstream update 2c5edf28ec851907305d73c6218ce75d39f1767f
Author: Hiltjo Posthuma <hiltjo@codemadness.org>
Date:   Wed Jan 12 09:44:27 2022 +0100

X10/SGR mouse: use alt as meta key instead of super/windows key
2022-01-20 20:31:22 +05:30
Ashish Kumar Yadav 8becd85927 Upstream update ea7cd7b62fdfa6a1fbd882d1565d557577f2cf32
Author: robert <robertrussell.72001@gmail.com>
Date: Sat Jan 8 11:40:34 2022 -0800

Fix mousereport

This patch replaces the previous one I sent.

The following changes are made in this patch:
 - Fix tracking of pressed buttons. Previously, pressing two buttons and
   then releasing one would make st think no buttons are pressed, which
   in particular broke MODE_MOUSEMOTION.
 - Always send the lowest-numbered pressed button on motion events; when
   no button is pressed for a motion event in MODE_MOUSEMANY, then send
   a release. This matches the behaviour of xterm. (Previously, st sent
   the most recently pressed button in the motion report.)
 - Remove UB (?) access to potentially inactive struct member
   e->xbutton.button of XEvent union.
 - Fix (unlikely) possibility of overflow for large button numbers.

The one discrepancy I found between st and xterm is that xterm sometimes
encodes buttons with large numbers (>5) strangely. E.g., xterm reports
presses of buttons 8 and 9 as releases, whereas st properly (?) encodes
them as presses.
2022-01-20 20:29:29 +05:30
Ashish Kumar Yadav fd43b7ccb0 Fixed typo in PKGBUILD 2022-01-18 12:29:10 +05:30
Ashish Kumar Yadav 1258eda7bd Bump version to 0.8.5 2022-01-08 00:09:33 +05:30
Ashish Kumar Yadav bd9e2beac7 Upstream 7e1c68f25d9f08687a94eeef8d7f8ffd0d14b911
Author: Hiltjo Posthuma <hiltjo@codemadness.org>
Date:   Sun Jan 2 12:15:45 2022 +0100

FAQ: fix a typo, patch -> path
2022-01-05 21:13:32 +05:30
Ashish Kumar Yadav 4714fdc9bf Upstream commit 65f1dc428315ae9d7f362e10c668557c1379e7af
Author: jamin <acdimalev@gmail.com>
Date:   Wed Dec 29 09:07:17 2021 -0800

Fix overtyping wide characters.

Overtyping the first half of a wide character with the
second half of a wide character results in display garbage.
This is because the trailing dummy is not cleaned up.

i.e.  ATTR_WIDE, ATTR_WDUMMY, ATTR_WDUMMY

Here is a short script for demonstrating the behavior:

#!/bin/sh
alias printf=/usr/bin/printf
printf こんにちは!; sleep 2
printf '\x1b[5D'; sleep 2
printf へ; sleep 2
printf ' '; sleep 2
echo
2022-01-05 21:12:17 +05:30
Ashish Kumar Yadav 43cc346637 Updated TODO 2021-12-28 23:53:20 +05:30
Ashish Kumar Yadav a6b07ad3bd Upstream Update
8e310303903792c010d03c046ba75f8b18f7d3a7
Add support for OSC color sequences

273db5ceaf392e68c2faf8f7dec14ea2e25e980d
follow-up fix for OSC color sequences, return

Otherwise the message "erresc: unknown str" is printed.

a0467c802d4f86ed162486e3453dd61181423902
Fix null pointer access in strhandle

According to the spec the argument is optional for 104, so p can be
NULL as can be tested with printf '\x1b]104\x07'. This is a regression
of 8e31030.
2021-12-28 14:37:57 +05:30
Ashish Kumar Yadav 8b7c67b591 Unnecessary after removal of tab copying 2021-12-27 23:58:55 +05:30
Ashish Kumar Yadav a6ed88b509 Reorderd glyph_attributes 2021-12-27 23:51:22 +05:30
Ashish Kumar Yadav 4c72575219 Removed the ability of copying tab characters
'\t' is for cursor movement, no point of workarounds to be able to copy
it. Anyway in alt screens like less and vim they are represented as ' '.
Not as useful as I thought while implementing.
2021-12-27 23:39:24 +05:30
Ashish Kumar Yadav bd4d655f69 Remove lingering ATTR_TDUMMY 2021-12-27 23:24:40 +05:30
Ashish Kumar Yadav b61b4529ce Removed unnecessary gp.state and GLYPH_*
Accomadated gp.state in gp.mode. This also fixes a bug introduced in the
text wrapping fix in the second last commit. gp.mode = GLYPH_SET might
have overwritten GLYPH_T* in gp.mode.
2021-12-27 23:12:22 +05:30
Ashish Kumar Yadav 5a5d33afa9 Fixed bug in and improved tab selsnapping 2021-12-26 21:14:36 +05:30
Ashish Kumar Yadav 558eda1214 Fixed two bugs - 1 text wrapping, 2 memory 2021-12-26 21:06:09 +05:30
Ashish Kumar Yadav 5dbb218d8b Fixed small bug in tgetline 2021-12-26 19:55:56 +05:30
Ashish Kumar Yadav 0dd12d9e02 Fix long standing bug
tswapscreen doesn't change term.dirty. Many others are unchanged. Be
careful with those.
2021-12-15 12:52:29 +05:30
Ashish Kumar Yadav d3c61342aa This hopefully completely fixes "letters disappear in nano" 2021-12-12 18:30:21 +05:30
Ashish Kumar Yadav 60d1e25445 Fixed bug in twritetab 2021-12-12 11:14:33 +05:30
Ashish Kumar Yadav 5296dee5e2 Consistency 2021-12-12 01:57:10 +05:30
Ashish Kumar Yadav 4160076bd0 Hopefully fixes 'Letters disappear in nano' issue
'\t' can also be used only for cursor movement.
2021-12-12 01:51:25 +05:30
Ashish Kumar Yadav a66a1b8e06 Cleanup - removed unnecessary duplication of code 2021-12-11 14:57:32 +05:30
Ashish Kumar Yadav bd304fa55e Fixed typo 2021-12-10 00:46:17 +05:30