Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 49 additions & 16 deletions kermit/k95/ckoco3.c
Original file line number Diff line number Diff line change
Expand Up @@ -13049,8 +13049,14 @@ vtcsi(void)
break;
}
break;
case '$':
achar = (escnext<=esclast)?escbuffer[escnext++]:0;
case '$': {/* These things below should probably only appear in a DCS string */
int acharTmp = (escnext <= esclast) ? escbuffer[escnext + 1] : 0;
if (acharTmp != '}' && acharTmp != '-' && acharTmp != '~') {
/* Next character isn't something we handle here - skip ahead */
goto LB2003;
}

achar = (escnext <= esclast) ? escbuffer[escnext++] : 0;
switch (achar) {
case '}':
/* DECSASD - Select Active Status Display */
Expand All @@ -13063,6 +13069,7 @@ vtcsi(void)
break;
}
break;
}
case 'S':
if ( private && ISAIXTERM(tt_type_mode) ) {
/* Show Status Line */
Expand Down Expand Up @@ -13664,20 +13671,46 @@ vtcsi(void)
/* pn[2] - left-col border default=1 */
/* pn[3] - bot-line border default=Height */
/* pn[4] - Right border default=Width */
if ( k < 4 || pn[4] > VscrnGetWidth(VTERM) ||
pn[4] < 1 )
pn[4] = VscrnGetWidth(VTERM);
if ( k < 3 || pn[3] > VscrnGetHeight(VTERM)
-(tt_status[VTERM]?1:0) || pn[3] < 1 )
pn[3] = VscrnGetHeight(VTERM)
-(tt_status[VTERM]?1:0);
if ( k < 2 || pn[2] < 1 )
pn[2] = 1 ;
if ( k < 1 || pn[1] < 1 )
pn[1] = 1 ;
clrrect_escape( VTERM, pn[1], pn[2],
pn[3], pn[4], SP ) ;
VscrnIsDirty(VTERM);

int maxHeight, maxWidth;
int top, left, bot, right;

maxHeight = VscrnGetHeight(VTERM)
-(tt_status[VTERM]?1:0);
maxWidth = VscrnGetWidth(VTERM);

top = pn[1];
left = pn[2];
bot = pn[3];
right = pn[4];

/* Defaults: the entire screen */
if (k < 4 || right < 1) right = maxWidth;
if (k < 3 || bot < 1) bot = maxHeight;
if (k < 2 || left < 1) left = 1;
if (k < 1 || top < 1) top = 1;

/* Coordinates are all relative to DECOM setting */
if (relcursor) {
top += margintop - 1;
bot += margintop - 1;
left += marginleft - 1;
right += marginleft - 1;
}

if (right > maxWidth) right = maxWidth;
if (bot > maxHeight) bot = maxHeight;

/* Do nothing if the rect is invalid (bottom > top
* or left > right) */
if (top <= bot && left <= right
&& top > 0 && left > 0) {
clrrect_escape(VTERM, top, left,
bot, right, SP);
VscrnIsDirty(VTERM);
} else {
debug(F111, "DECERA", "bad parameter(s) - ignore", 0);
}
}
break;
case '{': /* DECSERA - Selective Erase Rect Area */
Expand Down