Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: How to see history 'expression' in history rather than the expansion?



On Mon, Jun 13, 2022 at 3:34 AM Pier Paolo Grassi <pierpaolog@xxxxxxxxx> wrote:
>
> Hi Bart, can you elaborate on this? when/why does this happen?

I've mostly encountered it when using ssh to log in to hosts with
different operating systems (or sometimes even different revisions of
what's supposedly the same OS).  In fact I've hit it so often that my
.zlogin has this:

function stty_backspace {
    local bs
    while (( #bs != 8 && #bs != 127 ))
    do
        print -n 'Press backspace: '
        read -k 1 bs || return 1
        print -nP '\r%E'
    done
    stty erase "$bs"
}

This forces the local erase character to be set to whatever it
perceives the keyboard to be sending for whatever key my muscle-memory
whacks when I want to back up one character, so that editors etc.
match the zsh behavior.  I never change the default zsh bindings that
make ctrl-h and del both backward-delete-char, so in ZLE I don't care.

It's less an issue if you never find yourself moving between a Mac
laptop and a Windows PC and more than one Linux desktop on your local
end and probably not an issue at all if everything is also homogeneous
on the remote end.




Messages sorted by: Reverse Date, Date, Thread, Author