pike.git / lib / modules / Stdio.pmod / Readline.pike

version» Context lines:

pike.git/lib/modules/Stdio.pmod/Readline.pike:1: - // $Id: Readline.pike,v 1.63 2009/02/10 01:53:31 mast Exp $ +    #pike __REAL_VERSION__      //!   //! @fixme   //! Ought to have support for charset conversion.   class OutputController   {    protected private .File outfd;    protected private .Terminfo.Termcap term;    protected private int xpos = 0, columns = 0;
pike.git/lib/modules/Stdio.pmod/Readline.pike:416:    //!    void beep()    {    outfd->write(term->put("bl")||"");    }       //!    void create(.File|void _outfd,    .Terminfo.Termcap|string|void _term)    { -  outfd = _outfd || Stdio.File( "stdout", "w" ); +  outfd = _outfd || Stdio.FILE( "stdout", "w" ); +  if( outfd->set_charset ) +  outfd->set_charset( 0 ); // autodetect +     term = objectp(_term)? _term : .Terminfo.getTerm(_term);    catch { oldattrs = outfd->tcgetattr(); };    check_columns();    }   }      //!   //! @fixme   //! Ought to have support for charset conversion.   class InputController
pike.git/lib/modules/Stdio.pmod/Readline.pike:777:    mapping(int:function) bb = bindings-Array.filter(bindings, mappingp);    return `|(mkmapping(Array.map(indices(bb), lambda(int n) {    return sprintf("%c", n);    }), values(bb)),    @Array.filter(values(bindings), mappingp));    }       //!    void create(object|void _infd, object|string|void _term)    { -  infd = _infd || Stdio.File( "stdin", "r" ); +  infd = _infd; +  if( !_infd ) +  { +  infd = Stdio.FILE( "stdin", "r" ); +  if( infd->set_charset ) +  infd->set_charset( 0 ); // autodetect +  }    term = objectp(_term)? _term : .Terminfo.getTerm(_term);    disable();    if(search(term->aliases, "dumb")>=0) {    // Dumb terminal. Don't try anything fancy.    dumb = 1;    return;    }    catch { oldattrs = infd->tcgetattr(); };    if(catch { infd->tcsetattr((["ECHO":0])); }) {    // If echo can't be disabled, Readline won't work very well.