Fixed "clear" command now clears scrollback history.

Improved font bold rendering (minor tweak).
Added click step for terminal scroll.
This commit is contained in:
Martín Lucas Golini
2022-07-28 01:51:38 -03:00
parent d078108b96
commit 4227afce5b
4 changed files with 21 additions and 5 deletions

View File

@@ -237,6 +237,10 @@ class TerminalDisplay : public ITerminalDisplay {
bool isAltScr() const;
const Uint32& getClickStep() const;
void setClickStep( const Uint32& clickStep );
protected:
EE::Window::Window* mWindow;
std::vector<TerminalGlyph> mBuffer;
@@ -268,6 +272,7 @@ class TerminalDisplay : public ITerminalDisplay {
Clock mLastDoubleClick;
int mColumns{ 0 };
int mRows{ 0 };
Uint32 mClickStep{ 5 };
FrameBuffer* mFrameBuffer{ nullptr };
TerminalColorScheme mColorScheme;

View File

@@ -562,6 +562,14 @@ bool TerminalDisplay::isAltScr() const {
return mEmulator && mEmulator->tisaltscr();
}
const Uint32& TerminalDisplay::getClickStep() const {
return mClickStep;
}
void TerminalDisplay::setClickStep( const Uint32& clickStep ) {
mClickStep = clickStep;
}
void TerminalDisplay::update() {
if ( mFocus && isBlinkingCursor() && mClock.getElapsedTime().asSeconds() > 0.7 ) {
mMode ^= MODE_BLINK;
@@ -591,25 +599,25 @@ void TerminalDisplay::action( TerminalShortcutAction action ) {
break;
}
case TerminalShortcutAction::SCROLLUP_SCREEN: {
TerminalArg arg( (int)-1 );
TerminalArg arg( (int)-mClickStep );
mTerminal->kscrollup( &arg );
sendEvent( { EventType::SCROLL_HISTORY } );
break;
}
case TerminalShortcutAction::SCROLLDOWN_SCREEN: {
TerminalArg arg( (int)-1 );
TerminalArg arg( (int)-mClickStep );
mTerminal->kscrolldown( &arg );
sendEvent( { EventType::SCROLL_HISTORY } );
break;
}
case TerminalShortcutAction::SCROLLUP_ROW: {
TerminalArg arg( (int)1 );
TerminalArg arg( (int)mClickStep );
mTerminal->kscrollup( &arg );
sendEvent( { EventType::SCROLL_HISTORY } );
break;
}
case TerminalShortcutAction::SCROLLDOWN_ROW: {
TerminalArg arg( (int)1 );
TerminalArg arg( (int)mClickStep );
mTerminal->kscrolldown( &arg );
sendEvent( { EventType::SCROLL_HISTORY } );
break;

View File

@@ -1503,6 +1503,9 @@ void TerminalEmulator::csihandle( void ) {
tclearregion( 0, 0, mTerm.col - 1, mTerm.c.y - 1 );
tclearregion( 0, mTerm.c.y, mTerm.c.x, mTerm.c.y );
break;
case 3:
clearHistory();
// fallthrough
case 2: /* all */
tclearregion( 0, 0, mTerm.col - 1, mTerm.row - 1 );
break;