private int clearEcho(final int c) throws IOException {
        // if the terminal is not echoing, then ignore
        if (!terminal.isEchoEnabled()) {
            return 0;
        }

        // otherwise, clear
        int pos = getCursorPosition();
        int num = wcwidth(c, pos);
        moveCursorFromTo(pos + num, pos);
        drawBuffer(num);

        return num;
    }