Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Branch: master
Commits on Jul 13, 2015
Commits on Apr 13, 2015
  1. Version 1.0

    authored
    Linenoise is used in multiple projects for enough time, let's tag this
    commit with a version number as requested into issue #88, so that we
    have an initial reference.
    
    Given the nature of the library, the version was also added in the
    linenoise C and header file as well so that it is easy to realize for
    people having a copy embedded somewhere if they are using the latest
    version.
Commits on Oct 7, 2014
  1. License file added.

    authored
    However the files linenose.c and linenose.h already had inline licenses.
Commits on Sep 3, 2014
  1. Move to end before return when in multi-line mode.

    authored
    This makes sure that if we are editing in multi-line mode a line that
    actually spawns across multiple lines, the next output performed by the
    application using linenoise will not overwrite the edited line.
  2. Replace ESC 999D with CR.

    authored
    OSX default Terminal app does not handle 999D well, the cursor will wrap
    back to the previous row in the last colum, instead of ignoring the
    sequence if the cursor is already at the left edge.
    
    In order to avoid reintroducing the nG sequence that is not compatible
    with base VT100 emulation and ANSI.SYS, we use CR that should be
    hopefully widely supported.
  3. Don't emit ESC [ n C with n=0.

    authored
    This fixes a bug introduced with ANSI.SYS compatibility.
    When we want to move at a specific column, we need to emit the sequence
    to move the cursor to the right (after we moved 999 positions to the left)
    only if we want to actually move right at least 1 position, since a
    count of zero will still move the cursor one position to the right.
  4. Avoid CHA sequence for ANSI.SYS compatibility.

    authored
    Github user @welash proposed a change in issue #73 in order to improve
    the linenoise compatibility with older terminal emulators only able to
    deal with a subset of ANSI sequences, notably ANSI.SYS and VT100
    terminals strictly able to handle the original set of VT100 escape
    sequences.
    
    In order to improve the compatibility, the CHA sequence was removed and
    translated to move 999 positions to the left, then move on the right
    for the desired number of positions. The CHA sequence was apparently
    added only with VT220, that's why it is not available everywhere.
    
    This commit features almost exactly the change proposed in issue #73
    with a small fix for a bug in multi-line editing mode introduced by the
    patch.
Commits on Sep 2, 2014
Commits on Apr 18, 2014
  1. Multi line editing is no longer experimental.

    authored
    It is now the default in the Redis command line interface so it is
    used by many users every day.
  2. Linenoise is now ~ 1100 lines of code ;-)

    authored
    Fixes issue #63.
Commits on Mar 13, 2014
  1. Support for Home / End keys.

    authored
    Some terminal reports ESC [H and ESC [F, while some other reports
    ESC OH and ESC OF. We support both but there is at least another
    variant documented, hopefully no longer.
  2. Fix right arrow handling.

    authored
    Bug introduced in recent refactoring.
  3. If ioctl() fails get num of columns querying the terminal.

    authored
    This change makes linenoise both more robust if the ioctl() fails, and
    far more portable to non POSIX systems, since the ioclt() to query the
    terminal was probably one of the non trivial parts to replace.
    
    The code is inspired to Andreas Kupries commit 24186e9 on the win32
    Linenoise port from Steve Bennett, but is a complete reimplementation.
  4. Compare human readable key codes with chars literals.

    authored
    Many sequences are actually human readable and fall into the printable
    ASCII subset, they are a lot more recognizable when written as chars
    compared to numbers.
    
    For example up arrow is sent back from the terimal as ESC [A, and so
    forth.
    
    This commit makes the code speak the same "language" that you find in
    any terminal escape sequences documentation.
  5. Rename Scan codes -> Key codes.

    authored
    What we print in debug mode using the option (now) called --keycodes
    are not the scan codes, but the key codes returned by the terminal (a
    more higher level representation of the keys pressed).
    
    This commit fixes the word used.
Commits on Mar 12, 2014
  1. Scan codes debugging functionality.

    authored
    ./linenoise_example --scancodes
  2. Use the two-reads fix for the additional escapes as well.

    authored
    See commit e153bd8 for more information.
    The gist is that slow terminals may return a short read of 1 byte.
  3. Fix escape sequence processing when only one byte available

    Nick Gasson authored committed
    The read call in the escape sequence processing does not
    handle the case where only the first byte is available. This can
    happen for example on a slow serial terminal.
    
    Comment by @antirez:
    
    I reworked the code for brevity, for historical reasons here is the
    proposed patch. I believe my fix should be functionally equivalent.
    
    Original fix:
    
                 case 27:    /* escape sequence */
                     /* Read the next two bytes representing the
                        escape sequence. */
        -            if (read(fd,seq,2) == -1) break;
        +            {
        +                ssize_t b = read(fd, seq, 2);
        +
        +                if (b < 0) break;
        +
        +                if (b == 1) {
        +                    b = read(fd,&seq[1], 1);
        +                    if (b != 1) {
        +                        break;
        +                    }
        +                }
        +            }
    
    See PR #47.
  4. Add extern "C" around linenoise.h when compiled as C++

    Nick Gasson authored committed
  5. Merge pull request #48 from nickg/emacs

    authored
    Add "emacs" to unsupported_term
  6. Merge pull request #49 from polch/master_fixes

    authored
    fix linenoiseEdit buflen decreasing.
  7. Merge pull request #51 from MartinNowak/const

    authored
    use const char * when modification isn't necessary
  8. @shengwen1997

    Add the key enumeration

    shengwen1997 authored committed
  9. Debugging code cleanup.

    authored
Something went wrong with that request. Please try again.