Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Delkey patch #21

Closed
SageEx opened this issue Mar 12, 2017 · 18 comments
Closed

Delkey patch #21

SageEx opened this issue Mar 12, 2017 · 18 comments

Comments

@SageEx
Copy link

SageEx commented Mar 12, 2017

Can you include the delkey patch ?

@neeasade
Copy link
Member

what is your use-case for including? I had applied it initially but found I was fine with reverting and having default terminfo -- just curious what you're running into.

@SageEx
Copy link
Author

SageEx commented Mar 13, 2017

Well, without this patch, the delete key behaves like a F1 key. My term variable as set by St is st-256color, but the delete key sends F1 key, meaning many ncurses apps shortcuts don't work like ranger and ncmpcpp shortcuts.
How do you manage with the lack of delete key?

@pellettiero
Copy link

http://git.suckless.org/st/tree/FAQ
They talk about it here, last paragraph "The Backspace Case"

@neeasade
Copy link
Member

It appears I had a problem with my environment from previous debugging, where though I had removed the patch a terminfo stuck around with the definition -- I will apply the patch this evening.

@SageEx
Copy link
Author

SageEx commented Mar 14, 2017 via email

@parchd-1
Copy link

Since you added this patch back in, I seem to be having exactly the problems it is supposed to solve (when it works at all, my delete key is now behaving as a backspace. Backspace also behaves as a backspace). Rolling back to before you applied the patch, everything works fine.

@SageEx
Copy link
Author

SageEx commented Mar 21, 2017 via email

@parchd-1
Copy link

Without the patch, I just followed the guide in the st FAQ and aded a couple of workarounds into my profile for programs behaving badly (nvim, for example). Pretty much everything worked fine. With the patch, no matter what I do (or don't do) I can't use the delete key.

@SageEx
Copy link
Author

SageEx commented Mar 21, 2017 via email

@parchd-1
Copy link

What shell do you use?

@SageEx
Copy link
Author

SageEx commented Mar 21, 2017 via email

@parchd-1
Copy link

Here is the relavant part of my zshrc. Note, this does not work correctly when the patch is applied - you need to compile an older revision.

# Make the keyboard work correctly in st and similar terminals
function zle-line-init() {
    echoti smkx
}
function zle-line-finish() {
    echoti rmkx
}
zle -N zle-line-init
zle -N zle-line-finish

nvim(){  # fix delete key in neovim for the time being
    tput smkx
    command nvim $@
}

ipython(){  # apparentyl ipython also has the problem with delete, etc.
    tput smkx
    command ipython $@
}

bindkey "^[[1;5C" forward-word
bindkey "^[[1;5D" backward-word
bindkey "^[[1~" beginning-of-line
bindkey "^[[4~" end-of-line
bindkey "^[[3~" delete-char

@neeasade
Copy link
Member

With the patch, no matter what I do (or don't do) I can't use the delete key.

I experience the same. Will revert the patch.

@parchd-1
Copy link

Thanks

@SageEx
Copy link
Author

SageEx commented Mar 22, 2017 via email

@parchd-1
Copy link

@SageEx those two functions I used are not for ncurses programs, but both behave a bit badly in that they don't switch to application input mode. Last I checked the exact reason in neovim was being investigated. On my end, ncurses programs already function correctly. What makes you think ranger doesn't? Have you actually bound something to delete? Although the list of bindings it displays suggests is already bound, I found that it wasn't.

Try: map <delete> console delete in ranger and see if it works.

@SageEx
Copy link
Author

SageEx commented Mar 30, 2017

@parchd-1 I already have this mapping map <delete> console delete in ranger configs, and delete does not work. Any more ideas ?

@parchd-1
Copy link

Which version of xst are you using at the moment?
Also, have you tried setting that map directly in ranger instead of in a config - I doubt it will make a difference, but worth a go.

@ghost ghost mentioned this issue Jul 3, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants