Skip to content

Commit a07483a

Browse files
committed
fix: fix crash on Arch when creating new tab & fix cmake compile error
1. decoder.decodeLine(&_image[loc(0,cursorPos.y())],_usedColumns,_lineProperties[cursorPos.y()]); will raise an error when _lineProperties is empty. Check and early return in this case. 2. CMake Error at 3rdparty/terminalwidget/CMakeLists.txt:1 (cmake_minimum_required): Compatibility with CMake < 3.5 has been removed from CMake. Update the VERSION argument <min> value. Or, use the <min>...<max> syntax to tell CMake that the project requires at least <min> but has been updated to work with policies introduced by <max> or earlier. Or, add -DCMAKE_POLICY_VERSION_MINIMUM=3.5 to try configuring anyway. ... so we have to increase cmake_minimum_required After those fix deepin-terminal can be compiled and run on Archlinux without obvious bug.
1 parent 625d610 commit a07483a

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

3rdparty/terminalwidget/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
cmake_minimum_required(VERSION 3.1.0 FATAL_ERROR)
1+
cmake_minimum_required(VERSION 3.5.0 FATAL_ERROR)
22
# CMP0000: Call the cmake_minimum_required() command at the beginning of the top-level
33
# CMakeLists.txt file even before calling the project() command.
44
# The cmake_minimum_required(VERSION) command implicitly invokes the cmake_policy(VERSION)

3rdparty/terminalwidget/lib/TerminalDisplay.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3338,6 +3338,8 @@ QVariant TerminalDisplay::inputMethodQuery( Qt::InputMethodQuery query ) const
33383338
{
33393339
// return the text from the current line
33403340
QString lineText;
3341+
if (_lineProperties.isEmpty())
3342+
return lineText;
33413343
QTextStream stream(&lineText);
33423344
PlainTextDecoder decoder;
33433345
decoder.begin(&stream);

0 commit comments

Comments
 (0)