Commit 5389ec11 authored by Matan Ziv-Av's avatar Matan Ziv-Av
Browse files

Fix bugs in semantic shell integration

Bugs reported here:
!691 (comment 480025)
- Properly ignore OSC parameters for now. (later we'll support some).
- Handle Input end for when command gets shorter.
- Always draw separating line in foreground color
- Don't group characters of different REPL type.
- Don't reset double width/height attributes of erased lines.
parent dee1cfd7
Pipeline #199606 passed with stage
in 4 minutes and 1 second
......@@ -1225,6 +1225,11 @@ void Screen::clearImage(int loca, int loce, char c, bool resetLineRendition)
const int topLine = loca / _columns;
const int bottomLine = loce / _columns;
// When readline shortens text, it uses clearImage() to remove the extraneous text
if (_replMode != REPL_None && std::make_pair(topLine, loca % _columns) <= _replModeEnd) {
_replModeEnd = std::make_pair(topLine, loca % _columns);
}
Character clearCh(uint(c), _currentForeground, _currentBackground, DEFAULT_RENDITION, 0);
// if the character being used to clear the area is the same as the
......@@ -1241,7 +1246,12 @@ void Screen::clearImage(int loca, int loce, char c, bool resetLineRendition)
_lineProperties[y] = SetLineLength(_lineProperties[y], startCol);
}
} else {
_lineProperties[y] = LINE_DEFAULT;
if (resetLineRendition) {
_lineProperties[y] = LINE_DEFAULT;
}
{
_lineProperties[y] &= ~(LINE_WRAPPED | LINE_PROMPT_START | LINE_INPUT_START | LINE_OUTPUT_START);
}
}
QVector<Character> &line = _screenLines[y];
......@@ -1261,10 +1271,6 @@ void Screen::clearImage(int loca, int loce, char c, bool resetLineRendition)
std::fill(line.begin() + startCol, line.begin() + (endCol + 1), clearCh);
}
}
if (resetLineRendition && startCol == 0 && endCol == _columns - 1) {
_lineProperties[y] &= ~(LINE_DOUBLEWIDTH | LINE_DOUBLEHEIGHT_TOP | LINE_DOUBLEHEIGHT_BOTTOM);
}
}
}
......
......@@ -1048,19 +1048,19 @@ void Vt102Emulation::processSessionAttributeRequest(const int tokenSize, const u
}
if (attribute == 133) {
if (value == QLatin1String("A") || value == QLatin1String("N") || value == QLatin1String("P")) {
if (value[0] == L'A' || value[0] == L'N' || value[0] == L'P') {
_currentScreen->setReplMode(REPL_PROMPT);
}
if (value == QLatin1String("L") && _currentScreen->getCursorX() > 0) {
if (value[0] == L'L' && _currentScreen->getCursorX() > 0) {
_currentScreen->nextLine();
}
if (value == QLatin1String("B")) {
if (value[0] == L'B') {
_currentScreen->setReplMode(REPL_INPUT);
}
if (value == QLatin1String("C")) {
if (value[0] == L'C') {
_currentScreen->setReplMode(REPL_OUTPUT);
}
if (value == QLatin1String("D")) {
if (value[0] == L'D') {
_currentScreen->setReplMode(REPL_None);
}
}
......
......@@ -241,7 +241,7 @@ public:
inline bool hasSameRendition(Character lhs) const
{
return (lhs.rendition & ~RE_EXTENDED_CHAR) == (rendition & ~RE_EXTENDED_CHAR);
return (lhs.rendition & ~RE_EXTENDED_CHAR) == (rendition & ~RE_EXTENDED_CHAR) && lhs.flags == flags;
};
inline bool hasSameLineDrawStatus(Character lhs) const
......
......@@ -647,7 +647,7 @@ void SessionController::setupCommonActions()
connect(action, &QAction::triggered, this, &SessionController::copy);
action = collection->addAction(QStringLiteral("edit_copy_contextmenu_in_out"));
action->setText(i18n("Copy except propmts"));
action->setText(i18n("Copy except prompts"));
action->setIcon(QIcon::fromTheme(QStringLiteral("edit-copy")));
action->setVisible(false);
connect(action, &QAction::triggered, this, &SessionController::copyInputOutput);
......
......@@ -258,6 +258,8 @@ void TerminalPainter::drawContents(Character *image,
x += len - 1;
}
if ((lineProperty & LINE_PROMPT_START) != 0 && m_parentDisplay->filterChain()->showUrlHint()) {
QPen pen(m_parentDisplay->terminalColor()->foregroundColor());
paint.setPen(pen);
paint.drawLine(leftPadding, textY, m_parentDisplay->contentRect().right(), textY);
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment