Changeset 6010 for code/branches/console/src/libraries/core/IOConsole.cc
- Timestamp:
- Oct 31, 2009, 11:13:52 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/console/src/libraries/core/IOConsole.cc
r6007 r6010 50 50 { 51 51 IOConsole* IOConsole::singletonPtr_s = NULL; 52 const std::string promptString_g = "orxonox>";53 52 54 53 #ifdef ORXONOX_PLATFORM_UNIX … … 65 64 66 65 IOConsole::IOConsole() 67 : shell_(new Shell("IOConsole", false ))66 : shell_(new Shell("IOConsole", false, true)) 68 67 , buffer_(shell_->getInputBuffer()) 69 68 , originalTerminalSettings_(new termios()) 70 69 , bStatusPrinted_(false) 70 , promptString_("orxonox> ") 71 71 { 72 72 this->setTerminalMode(); … … 143 143 this->buffer_->buttonPressed(KeyEvent(KeyCode::End, 0, 0)); 144 144 else if (escapeSequence == "5~") 145 this->buffer_->buttonPressed(KeyEvent(KeyCode:: AltPageUp, 0, 0));145 this->buffer_->buttonPressed(KeyEvent(KeyCode::PageUp, 0, 0)); 146 146 else if (escapeSequence == "6~") 147 this->buffer_->buttonPressed(KeyEvent(KeyCode:: AltPageDown, 0, 0));147 this->buffer_->buttonPressed(KeyEvent(KeyCode::PageDown, 0, 0)); 148 148 else 149 149 // Waiting for sequence to complete … … 192 192 this->printStatusLines(); 193 193 this->printInputLine(); 194 std::cout.flush(); 194 195 } 195 196 … … 227 228 // Reset colour to white 228 229 // std::cout << "\033[37m"; 229 std::cout.flush();230 230 } 231 231 … … 244 244 if (this->buffer_->getCursorPosition() > 0) 245 245 std::cout << "\033[" << this->buffer_->getCursorPosition() << "C"; 246 std::cout.flush();247 246 } 248 247 … … 259 258 } 260 259 std::cout << "Status" << std::endl; 261 std::cout.flush();262 260 this->bStatusPrinted_ = true; 263 261 } … … 332 330 } 333 331 332 void IOConsole::printStatusLines() 333 { 334 } 335 334 336 #endif /* ORXONOX_PLATFORM_UNIX */ 335 337 … … 378 380 this->printStatusLines(); 379 381 this->printInputLine(); 382 std::cout.flush(); 380 383 } 381 384 … … 387 390 { 388 391 this->printInputLine(); 392 std::cout.flush(); 389 393 } 390 394 … … 396 400 { 397 401 this->printInputLine(); 402 std::cout.flush(); 398 403 } 399 404 … … 404 409 void IOConsole::executed() 405 410 { 406 // Move cursor the beginning of the line 407 std::cout << "\033[1G"; 408 // Print command so the user knows what he has typed 409 std::cout << promptString_g << this->shell_->getInput() << std::endl; 410 this->printInputLine(); 411 this->shell_->addOutputLine(this->promptString_ + this->shell_->getInput()); 411 412 } 412 413
Note: See TracChangeset
for help on using the changeset viewer.