Re: [hackers] [[st][PATCH]] Move term_mode to st.h

From: Devin J. Pohly <djpohly_AT_gmail.com>
Date: Mon, 19 Mar 2018 16:54:18 -0500

On Fri, Mar 16, 2018 at 11:23:08PM +0800, Ivan Tham wrote:
> This allows MODE_ALTSCREEN to be applied to scrollback patch in x.c
> ---
> st.c | 11 -----------
> st.h | 11 +++++++++++
> 2 files changed, 11 insertions(+), 11 deletions(-)
>
> diff --git a/st.c b/st.c
> index 65a0cb6..1eafc0e 100644
> --- a/st.c
> +++ b/st.c
> _AT_@ -47,17 +47,6 @@
> /* constants */
> #define ISO14755CMD "dmenu -w \"$WINDOWID\" -p codepoint: </dev/null"
>
> -enum term_mode {
> - MODE_WRAP = 1 << 0,
> - MODE_INSERT = 1 << 1,
> - MODE_ALTSCREEN = 1 << 2,
> - MODE_CRLF = 1 << 3,
> - MODE_ECHO = 1 << 4,
> - MODE_PRINT = 1 << 5,
> - MODE_UTF8 = 1 << 6,
> - MODE_SIXEL = 1 << 7,
> -};
> -
> enum cursor_movement {
> CURSOR_SAVE,
> CURSOR_LOAD
> diff --git a/st.h b/st.h
> index dac64d8..624f72f 100644
> --- a/st.h
> +++ b/st.h
> _AT_@ -52,6 +52,17 @@ enum selection_snap {
> SNAP_LINE = 2
> };
>
> +enum term_mode {
> + MODE_WRAP = 1 << 0,
> + MODE_INSERT = 1 << 1,
> + MODE_ALTSCREEN = 1 << 2,
> + MODE_CRLF = 1 << 3,
> + MODE_ECHO = 1 << 4,
> + MODE_PRINT = 1 << 5,
> + MODE_UTF8 = 1 << 6,
> + MODE_SIXEL = 1 << 7,
> +};
> +
> typedef unsigned char uchar;
> typedef unsigned int uint;
> typedef unsigned long ulong;
> --
> 2.16.2
>
>

This won't work - the Term instance is now internal to st.c, and IS_SET
in x.c refers to win.mode (on the TermWindow instance) which doesn't
contain MODE_ALTSCREEN.

How about checking it in kscrollup/kscrolldown, over on the st.c side of
things? (To be honest, the ^E/^Y behavior already seems like kind of a
compatibility hack for programs that lack actual mouse reporting.)

*dp


-- 
<><
Received on Mon Mar 19 2018 - 22:54:18 CET

This archive was generated by hypermail 2.3.0 : Mon Mar 19 2018 - 23:00:26 CET