(Tested with 2012-08-01 and 2012-11-21 version.)

Following is my ~/.kshrc:

### kshrc begin ###
compound -r g=( typeset -F3 ed_seconds=0)
function _keybd_jj
{
    if (( .sh.edcol == 0 )); then
        (( g.ed_seconds = SECONDS ))
        return
    fi

    if [[ ${.sh.edchar} == j && ${.sh.edmode} == $'\e' ]]; then
        if [[ ${.sh.edtext:.sh.edcol - 1:1} == j ]] \
            && (( SECONDS - g.ed_seconds > .1 && SECONDS - g.ed_seconds < 1
))
        then
            .sh.edchar=$'\b\e'
        else
            (( g.ed_seconds = SECONDS ))
        fi
    fi
}
trap _keybd_jj KEYBD
PS1='$ '
### kshrc end ###

Now, start ksh and ...

$ ksh
$ sleep 60
^C$ sleep 60
^C$ s
$ l
$ e
$ e
$ p
$

After the sleep command was killed twice by ctrl-c, the command line became
crazy and I could not input another sleep command.
_______________________________________________
ast-users mailing list
[email protected]
http://lists.research.att.com/mailman/listinfo/ast-users

Reply via email to