octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #61000] clc command does not totally clean the


From: John W. Eaton
Subject: [Octave-bug-tracker] [bug #61000] clc command does not totally clean the command window. The history can still be traversed using the scroll bar.
Date: Mon, 2 Aug 2021 10:34:43 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Firefox/78.0

Follow-up Comment #7, bug #61000 (project octave):

Whether running in a terminal window in CLI mode or in the GUI (also inside a
somewhat capable terminal emulator) Octave normally calls a readline function
to clear the terminal.  It just writes whatever escape sequence that terminfo
has registered for the "clear" capability.  Then the terminal does whatever it
does to clear the screen.  For the QTerminal widget that Octave is currently
using, the function that ultimately does the job is Screen::clearEntireScreen
in libgui/qterminal/libqterminal/unix/Screen.cpp:


void Screen::clearEntireScreen()
{
  // Add entire screen to history
  for (int i = 0; i < (lines-1); i++)
  {
    addHistLine(); scrollUp(0,1);
  }

  clearImage(loc(0,0),loc(columns-1,lines-1),' ');
}


As noted in comment #5, this is also what bash does because it uses readline. 
But what actually happens in the terminal window where bash is running is up
to the terminal.  That might be hardware or some teriminal emulation program
like xterm or gnome terminal, etc.

Perhaps in the future when we switch to a different type of terminal interface
we might do something different.  But for now, I don't think it is worth the
effort to change this behavior.  See also
https://octave.discourse.group/t/new-command-window-widget/501 for a
discussion about the possibility of a new terminal widget.

    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?61000>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]