diff --git a/src/plugins/terminal/celllayout.cpp b/src/plugins/terminal/celllayout.cpp index 45b7ca07835..a2628eccb05 100644 --- a/src/plugins/terminal/celllayout.cpp +++ b/src/plugins/terminal/celllayout.cpp @@ -101,6 +101,8 @@ void createTextLayout(QTextLayout &textLayout, if (cell->chars[0] != 0xFFFFFFFF) { QString ch = QString::fromUcs4(cell->chars); + if (ch == ' ') + ch = QChar::Nbsp; if (ch.size() > 0) { layoutText += ch; } else { diff --git a/src/plugins/terminal/terminalwidget.cpp b/src/plugins/terminal/terminalwidget.cpp index 7c76fa76084..8325f2839c7 100644 --- a/src/plugins/terminal/terminalwidget.cpp +++ b/src/plugins/terminal/terminalwidget.cpp @@ -390,6 +390,8 @@ void TerminalWidget::copyToClipboard() const .trimmed()); } + selectedText.replace(QChar::Nbsp, QChar::Space); + setClipboardAndSelection(selectedText); } }