You are not logged in.

#1 2020-03-31 22:49:25

miomio
Member
Registered: 2016-01-17
Posts: 167

[SOLVED] St terminal + delkey behaviour

From the st/FAQ there's an instruction to patch st to get delkey working  (https://git.suckless.org/st/file/FAQ.html#l157) but that patch is out of date for the current version of st and fails to merge. What do I need to do to get delkey working?

I wouldn't care if del just didn't do anything, but a) del keypress breaks backspace and tab, and 2) I use del key often.

To summarise with a test case:

$ fjflejflesjflkejrlkejrglkjse
<left arrow to center>
<hit bksp (**note 1)>
<hit DEL (**note 2)>
<hit bksp (**note 3)>

Result: note1 - char is deleted; note2 - char that was just deleted using bksp is inserted per DEL keypress; note3 - bksp doesn't work. 

I'm having to ctrl+c to get a new prompt each time to restore tab and bksp function. It's a pain.

If I do Fn+Ctrl+Alt+F2 for a different tty and don't startx but just use the vc and do:

$ fjflejflesjflkejrlkejrglkjse
<left arrow to center>
<hit bksp (**note 1)>
<hit DEL (**note 2)>
<hit bksp (**note 3)>
Result: note1 - char is deleted; note2 - tilde is inserted; note3 - char is deleted (bksp still functional). 

^Which shows it's st shitting on tab and bksp.

I'm a novice and don't find the keybindings in st/config.def.h straightforward because a) I'm not sure what these strings are doing or where they come from to play around (https://git.suckless.org/st/file/config.def.h.html#l262), and b) reading the arch wiki about X scancodes -> keycodes -> keymaps is somewhat difficult to understand despite them being detailed since what I observe with the terminal tools isn't matching X11/keysym.h || X11/keysymdef.h || /usr/include/linx/input-event-codes.h so is now a rabbit hole for me.

Feedback appreciated.

Last edited by miomio (2020-04-01 09:03:44)

Offline

#2 2020-03-31 22:54:54

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,522
Website

Re: [SOLVED] St terminal + delkey behaviour

Huh, I use st and had never noticed this.  I just had to test a bare st and confirmed DEL does nothing.  But I can't replicate the issues with backspace or tab.  But again I never noticed this as I run tmux.  I have one st open at startup and it automatically opens (or attaches to) a tmux session.  DEL works as expected within tmux in st.


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#3 2020-03-31 22:56:35

miomio
Member
Registered: 2016-01-17
Posts: 167

Re: [SOLVED] St terminal + delkey behaviour

If I spawn a new st window and use the same test case but minus the first step (so don't hit bksp first) and just do the del then bksp, I do not observe chars previously deleted by bksp being inserted. This matches your result. However, the result of bksp and tab breaking for me still remains the final outcome.

It's almost as if for me at least the bksp'd char is being saved in a buffer somewhere and del is using that to insert, otherwise it doesn't have anything to insert.

I tested with tmux per your experience and in doing so the behaviour is a little different:

$ tmux
$ fjflejflesjflkejrlkejrglkjse
<left arrow to center>
<hit bksp (**note 1)>
<hit DEL (**note 2)>
<hit bksp (**note 3)>
Result: note1 - char is deleted; note2 - del replaces alphabetical chars with their uppercase equivalents and does so in threes; note3 - bksp and tab are broken. 

I thought perhaps I introduced a bug(s) through the patches I've applied, so I re-cloned in a different dir the st codebase and rebuilt, reinstalled, retested. I'm pleased to report no difference in the results.

EDIT:

Think this has something to do with zsh. If I run bash in st, delkey does nothing but doesn't break tab or bksp. However, if I move my .zshrc and .zprofile to $file_BK and rm .zcompdump and spawn a new st with zsh not loading anything, the test result is the same with the exception that the delkey doesn't insert previous bksp deleted char or cause chars to turn uppercase in threes. Strange.

Last edited by miomio (2020-03-31 23:27:55)

Offline

#4 2020-04-01 01:24:11

Steef435
Member
Registered: 2013-08-29
Posts: 577
Website

Re: [SOLVED] St terminal + delkey behaviour

miomio wrote:

Think this has something to do with zsh.

Well, you can configure zsh to do the right thing.

EDIT in fear of being unclear: the example listed should make the delete key do what you expect, it does for me in st. Does that work?

Last edited by Steef435 (2020-04-01 01:28:46)

Offline

Board footer

Powered by FluxBB