[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Question



On Fri, May 11, 2001 at 09:08:37PM -0400, Steve M. Robbins wrote:
> I'm not really sure what ^U is supposed to do.  For me, it erases
> everything LEFT of the cursor.  The terminal is updated correctly.

Exactly. But if echok is not set (on my system), it just prints "^U",
but acts like it cleared all of the characters.

The responsible code is here (driver/char/n_tty.c:355-367):

if (!L_ECHOK(tty) || !L_ECHOKE(tty) || !L_ECHOE(tty)) {
    spin_lock_irqsave(&tty->read_lock, flags);
    tty->read_cnt -= ((tty->read_head - tty->canon_head) &
              (N_TTY_BUF_SIZE - 1));
    tty->read_head = tty->canon_head;
    spin_unlock_irqrestore(&tty->read_lock, flags);
    finish_erasing(tty);
    echo_char(KILL_CHAR(tty), tty);
    /* Add a newline if ECHOK is on and ECHOKE is off. */
    if (L_ECHOK(tty))
        opost('\n', tty);
    return;
}

As you can see, if any of echok/echoke/echoe is off, then it calls
finish_erasing(tty), which prevents the clearing, and then outputs the
kill character itself as "^U" (yes, two characters).

This is kernel 2.4.4. What about other kernels?

-- 
Taral <taral@taral.net>
Please use PGP/GPG encryption to send me mail.
"Any technology, no matter how primitive, is magic to those who don't
understand it." -- Florence Ambrose

Attachment: pgpVgJ_9LhAkM.pgp
Description: PGP signature


Reply to: