Emulatore Terminale "st" e tasto Canc

Postate qui per tutte le discussioni legate a Linux in generale.

Moderatore: Staff

Regole del forum
1) Citare sempre la versione di Slackware usata, la versione del Kernel e magari anche la versione della libreria coinvolta. Questi dati aiutano le persone che possono rispondere.
2) Per evitare confusione prego inserire in questo forum solo topic che riguardano appunto Gnu/Linux in genere, se l'argomento è specifico alla Slackware usate uno dei forum Slackware o Slackware64.
3) Leggere attentamente le risposte ricevute
4) Scrivere i messaggi con il colore di default, evitare altri colori.
5) Scrivere in Italiano o in Inglese, se possibile grammaticalmente corretto, evitate stili di scrittura poco chiari, quindi nessuna abbreviazione tipo telegramma o scrittura stile SMS o CHAT.
6) Appena registrati è consigliato presentarsi nel forum dedicato.

La non osservanza delle regole porta a provvedimenti di vari tipo da parte dello staff, in particolare la non osservanza della regola 5 porta alla cancellazione del post e alla segnalazione dell'utente. In caso di recidività l'utente rischia il ban temporaneo.
Rispondi
Avatar utente
joe
Iper Master
Iper Master
Messaggi: 3789
Iscritto il: ven 27 apr 2007, 11:21
Slackware: 15.0
Kernel: 5.15.38
Desktop: dwm

Emulatore Terminale "st" e tasto Canc

Messaggio da joe »

Come da oggetto il terminale che uso "st" in ambiente dwm ha qualche problema col tasto canc che praticamente non funziona per niente.

st versione 0.8.1

Ho provato anche una patch apposita "delkey", ma non ha sortito alcun risultato. Il Canc continua a non funzionare.
La cosa si risolve lavorando dentro una sessione "screen", infatti è già da mesi che uso st ma non mi ero mai accorto della cosa perché lancio sempre screen all'avvio del terminale.

Mi pare che qualcuno qui stava provando dwm col terminale simple terminal "st".
Avete qualche suggerimento?

Grazie in anticipo! :)

Avatar utente
joe
Iper Master
Iper Master
Messaggi: 3789
Iscritto il: ven 27 apr 2007, 11:21
Slackware: 15.0
Kernel: 5.15.38
Desktop: dwm

Re: Emulatore Terminale "st" e tasto Canc

Messaggio da joe »

Praticamente il problema è identico a quello descritto qui:
https://www.reddit.com/r/archlinux/comm ... key_in_st/

Dice anche che patch messe sul sito di st non funzionano, come risulta anche a me.
Il comando suggerito invece risolve:

Codice: Seleziona tutto

tput smkx
L'ho messo in "~/.baschrc" per rendere la cosa permanente...
Non so se sia la soluzione più pulita, ma funziona.

Avatar utente
joe
Iper Master
Iper Master
Messaggi: 3789
Iscritto il: ven 27 apr 2007, 11:21
Slackware: 15.0
Kernel: 5.15.38
Desktop: dwm

Re: Emulatore Terminale "st" e tasto Canc

Messaggio da joe »

Invece non mi funziona quest'altra soluzione:
https://www.reddit.com/r/suckless/comme ... elete_key/

Codice: Seleziona tutto

echo "set enable-keypad on" >> ~/.inputrc
Se, dopo aver settato inputrc come sopra, provo a chiudere il terminale st e lanciarlo nuovamente il tasto Canc/Del non funziona comunque

Avatar utente
joe
Iper Master
Iper Master
Messaggi: 3789
Iscritto il: ven 27 apr 2007, 11:21
Slackware: 15.0
Kernel: 5.15.38
Desktop: dwm

Re: Emulatore Terminale "st" e tasto Canc

Messaggio da joe »

https://git.suckless.org/st/file/FAQ.html ha scritto: ## Why doesn't the Del key work in some programs?

Taken from the terminfo manpage:

If the terminal has a keypad that transmits codes when the keys
are pressed, this information can be given. Note that it is not
possible to handle terminals where the keypad only works in
local (this applies, for example, to the unshifted HP 2621 keys).
If the keypad can be set to transmit or not transmit, give these
codes as smkx and rmkx. Otherwise the keypad is assumed to
always transmit.

In the st case smkx=E[?1hE= and rmkx=E[?1lE>, so it is mandatory that
applications which want to test against keypad keys send these
sequences.

But buggy applications (like bash and irssi, for example) don't do this. A fast
solution for them is to use the following command:

$ printf '\033[?1h\033=' >/dev/tty

or
$ tput smkx

In the case of bash, readline is used. Readline has a different note in its
manpage about this issue:

enable-keypad (Off)
When set to On, readline will try to enable the
application keypad when it is called. Some systems
need this to enable arrow keys.

Adding this option to your .inputrc will fix the keypad problem for all
applications using readline.

If you are using zsh, then read the zsh FAQ
<http://zsh.sourceforge.net/FAQ/zshfaq03.html#l25>:

It should be noted that the O / [ confusion can occur with other keys
such as Home and End. Some systems let you query the key sequences
sent by these keys from the system's terminal database, terminfo.
Unfortunately, the key sequences given there typically apply to the
mode that is not the one zsh uses by default (it's the "application"
mode rather than the "raw" mode). Explaining the use of terminfo is
outside of the scope of this FAQ, but if you wish to use the key
sequences given there you can tell the line editor to turn on
"application" mode when it starts and turn it off when it stops:

function zle-line-init () { echoti smkx }
function zle-line-finish () { echoti rmkx }
zle -N zle-line-init
zle -N zle-line-finish

Putting these lines into your .zshrc will fix the problems.
https://git.suckless.org/st/file/FAQ.html#l25

Avatar utente
joe
Iper Master
Iper Master
Messaggi: 3789
Iscritto il: ven 27 apr 2007, 11:21
Slackware: 15.0
Kernel: 5.15.38
Desktop: dwm

Re: Emulatore Terminale "st" e tasto Canc

Messaggio da joe »

Tant'è la modifica in inputrc che dovrebbe correggere il comportamento dei programmi basati su readline (come bash da quel che ho capito) a me non funziona

Rispondi