Skip to content

Commit

Permalink
fix: cursor position error when display completion (#337)
Browse files Browse the repository at this point in the history
Triggering completion when cursor is in command might lead to cursor
position error cause patch of bug 67102 trims trailing '\b' which
is not suitable for this case. As 67102 is not totally resolved(I
can still reproduce this), we just simply revert the modification.

Log: fix cursor position error when display completion
Issue: linuxdeepin/developer-center#5208
Related-To: https://pms.uniontech.com/bug-view-67102.html
Partially-Revert: 24ec7f9
  • Loading branch information
asterwyx authored Mar 7, 2024
1 parent 29e8a63 commit 13948b7
Showing 1 changed file with 0 additions and 9 deletions.
9 changes: 0 additions & 9 deletions 3rdparty/terminalwidget/lib/Emulation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -337,15 +337,6 @@ void Emulation::receiveData(const char *text, int length, bool isCommandExec)
utf16Text = _decoder->toUnicode(text, length);
}

//fix bug 67102 打开超长名称的文件夹,终端界面光标位置不在最后一位
//bash 提示符很长的情况下,会有较大概率以五个\b字符结尾,导致光标错位
if (utf16Text.startsWith("\u001B]0;") && utf16Text.endsWith("\b\b\b\b\b")) {
Session *currSession = SessionManager::instance()->idToSession(_sessionId);
if (currSession && (QStringLiteral("bash") == currSession->foregroundProcessName())) {
utf16Text.replace("\b\b\b\b\b", "");
}
}

std::wstring unicodeText = utf16Text.toStdWString();

//send characters to terminal emulator
Expand Down

0 comments on commit 13948b7

Please sign in to comment.