Re: [dev] [st] Home key does not work in yash

From: Страхиња Радић <sr_AT_strahinja.org>
Date: Sun, 11 Aug 2024 13:10:16 +0200

Дана 24/08/10 04:16PM, Roberto E. Vargas Caballero написа:
> [...] In fact,
> the backspace patch modifies the value exported by st because
> otherwise it would not work.

If you mean the delkey patch[1], it doesn't seem to change the TERM
environment variable, nor the termname global variable in st's
config.h. Maybe I'm misunderstanding what you said?


> St is already setting the correct value of TERM, can you explain me a
> reason why you would like to overwrite the value set by st?

The main reason for me to export TERM was to be in control of what it
is set to by my initialization files in different scenarios, like using
yaft[2] and logging in on Linux tty or through ssh. I normally use
tmux with st as well.

I use past tense because, after giving this a bit of a thought, now
that I am using OpenBSD as my primary OS, and I didn't use yaft for a
while, I can just let tmux set TERM to "tmux-256color", for which I
already have:

        set -g default-terminal "tmux-256color"

At topic though, I admit I was wrong about the issue not having to do
with TERM. I couldn't test this properly because I wasn't running

        TERM=linux-s yash

from "pure" st, but from tmux inside of st (I have set up C-M-Enter to
run `st -e tmux -u` in my config.h for dwm). tmux seems to present
another "layer" between the program and the terminal, and while in yash
running under st + tmux, with the above command, the result of

        echo $TERM

is "linux-s", it doesn't seem to have any effect on what keys are
passed to yash in such a setup. I noticed the issue only when I
explicitly ran st alone, then `TERM=linux-s yash` from there.

What seems to be the cause of the issue for the OP is the line

        export TERM=linux-s

in his $HOME/.yashrc. It should be commented out, or at least put in
some conditional, testing for whether the shell is running from a tty or
from st (X.Org, GUI, whatever).


[1]: https://st.suckless.org/patches/delkey/
[2]: https://github.com/uobikiemukot/yaft
Received on Sun Aug 11 2024 - 13:10:16 CEST

This archive was generated by hypermail 2.3.0 : Sun Aug 11 2024 - 13:12:09 CEST