FACT++  1.0
void ReadlineWindow::Shutdown ( const char *  buf)
protectedvirtual

Overwrites Shutdown() of Readline. After Readline::Prompt has returned a Redisplay() is forced to ensure a proper display of everything. Finally, the display line is ended by a
.

Parameters
bufThe buffer returned by the readline call

Reimplemented from Readline.

Reimplemented in Shell.

Definition at line 341 of file ReadlineWindow.cc.

References fPromptX, fPromptY, fWindow, and Readline::GetPrompt().

Referenced by Refresh(), and Shell::Shutdown().

342 {
343  // Move the cursor to the end of the total line entered by the user
344  // (the user might have pressed return in the middle of the line)...
345  int lines, cols;
346  getmaxyx(fWindow, lines, cols);
347 
348  // Calculate absolute position in window or beginning of output
349  // We can't take a pointer to the buffer because rl_end is not
350  // valid anymore at the end of a readline call
351  int xy = fPromptY*cols + fPromptX + GetPrompt().size() + strlen(buf);
352  wmove(fWindow, xy/cols, xy%cols);
353 
354  // ...and output a newline. We have to do the manually.
355  wprintw(fWindow, "\n");
356 
357  // refresh the screen
358  wrefresh(fWindow);
359 
360  // This might have scrolled the window
361  if (xy/cols==lines-1)
362  fPromptY--;
363 }
WINDOW * fWindow
static std::string GetPrompt()
Definition: Readline.cc:751
int fPromptY
When the readline call is issued the x position at which the output will start is stored here...
int fPromptX
Pointer to the panel for the input stream.

+ Here is the call graph for this function:

+ Here is the caller graph for this function: