|
From: stephan b. <sg...@us...> - 2004-06-01 06:58:40
|
Update of /cvsroot/qub/eshell/lib/eshell In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8096 Modified Files: eshell.cpp eshell.h Log Message: fixed: read_line() now appends to Readline history Index: eshell.cpp =================================================================== RCS file: /cvsroot/qub/eshell/lib/eshell/eshell.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- eshell.cpp 1 Jun 2004 03:30:58 -0000 1.6 +++ eshell.cpp 1 Jun 2004 06:58:31 -0000 1.7 @@ -196,11 +196,14 @@ std::string read_line( const std::string & prompt, bool & breakout ) { std::string realprompt = env().expand_vars( prompt ); + std::string str; #if HAVE_LIBREADLINECPP - return readline().readline( realprompt, breakout ); + str = readline().readline( realprompt, breakout ); + if( breakout ) return ""; + if( ! str.empty() ) readline().add_history( str ); + return str; #else std::cout << realprompt; - std::string str; breakout = std::getline( std::cin, str ).eof(); return breakout ? "" : str; #endif // HAVE_LIBREADLINECPP Index: eshell.h =================================================================== RCS file: /cvsroot/qub/eshell/lib/eshell/eshell.h,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- eshell.h 31 May 2004 19:56:03 -0000 1.3 +++ eshell.h 1 Jun 2004 06:58:31 -0000 1.4 @@ -271,7 +271,9 @@ depends on the exact input method used by this library. Note that $var expansion are done on prompt, so it may - container environment variables. + container environment variables. Also, the input line is + added to the command-line history if this library is build + with libreadline_cpp support. No other processing is done: the exact input value is passed back to the client without eshell dispatching it or |