Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

QTerminal crashes when executed in Qt Creator #793

Closed
AlexanderZhirov opened this issue Feb 7, 2021 · 2 comments
Closed

QTerminal crashes when executed in Qt Creator #793

AlexanderZhirov opened this issue Feb 7, 2021 · 2 comments

Comments

@AlexanderZhirov
Copy link

AlexanderZhirov commented Feb 7, 2021

My appeal was ignored here, but I ask you to pay attention to the nuances.

When launching a project with QTerminal support in the Qt Creator development environment, execution fails and the program crashes with the message

Cannot change to working directory «/home/user/Programming/build-test-Desktop_Qt_5_15_2_GCC_64bit-Debug»: file or directory not found

If launch Qt Creator through the terminal and try to start the project again, then QTerminal will display the following output in the console:

user@vb:~$ qtcreator
Properties constructor called
TRANSLATIONS_DIR: Loading translation file "qterminal_ru_RU.qm" from dir /usr/share/qterminal/translations
load success: true
Icon theme "elementary" not found.
QDir::exists: Empty or null file name
QDir::exists: Empty or null file name
Canot open file "/home/user/.config/qterminal.org/qterminal_bookmarks.xml"
Trying to load translation file from dir "/usr/share/Lubuntu"
Trying to load translation file from dir "/usr/local/share"
Trying to load translation file from dir "/usr/share"
Trying to load translation file from dir "/var/lib/snapd/desktop"
Trying to load translation file from dir "/usr/share/qtermwidget5/translations"
default KB_LAYOUT_DIR:  "/usr/share/qtermwidget5/kb-layouts"
loadAllColorSchemes
Shell program: "/opt/Qt/Tools/QtCreator/bin/../libexec/qtcreator/qtcreator_process_stub run /tmp/QtCreator.ZPtjNF/stub-socket Для закрытия данного окна нажмите <ВВОД>... /home/user/Programming/build-test-Desktop_Qt_5_15_2_GCC_64bit-Debug /tmp/QtCreator.kcxFmh 1130 /home/user/Programming/build-test-Desktop_Qt_5_15_2_GCC_64bit-Debug/test"
("/opt/Qt/Tools/QtCreator/bin/../libexec/qtcreator/qtcreator_process_stub", "run", "/tmp/QtCreator.ZPtjNF/stub-socket", "Для", "закрытия", "данного", "окна", "нажмите", "<ВВОД>...", "/home/user/Programming/build-test-Desktop_Qt_5_15_2_GCC_64bit-Debug", "/tmp/QtCreator.kcxFmh", "1130", "/home/user/Programming/build-test-Desktop_Qt_5_15_2_GCC_64bit-Debug/test")
Invalid run control state transition from  "RunControlState::Starting"  to  "RunControlState::Stopped"
Properties destructor called

In line

Shell program: "/opt/Qt/Tools/QtCreator/bin/../libexec/qtcreator/qtcreator_process_stub run /tmp/QtCreator.ZPtjNF/stub-socket Для закрытия данного окна нажмите <ВВОД>... /home/user/Programming/build-test-Desktop_Qt_5_15_2_GCC_64bit-Debug /tmp/QtCreator.kcxFmh 1130 /home/user/Programming/build-test-Desktop_Qt_5_15_2_GCC_64bit-Debug/test"

the program starts, but somewhere everything is interrupted and the program ends with an error.
Why do I think the problem is in QTerminal? Because when installing XTerm, I run the project without errors and XTerm allows you to manage the project through the console. After the end of the program execution XTerm asks to confirm the "Enter" in the line:

Для закрытия данного окна нажмите <ВВОД>...

Please pay attention to the execution of the program above through QTerminal. The same message appears in the Shell program line, but without the terminal itself, which once again indicates that the terminal is crashing spontaneously.

If you can look somewhere additional information about the error inside the distribution - I will provide it, if someone tells me where to look it.

@e4z9
Copy link

e4z9 commented Feb 11, 2021

The -e option of qterminal breaks with arguments that contain whitespace.
https://github.com/lxqt/qterminal/blob/master/src/main.cpp#L90 concatenates all arguments after -e into a single string, and later breaks that up at whitespace again. That breaks executables that are located in paths with spaces, and also command line arguments that contain spaces.

E.g.

qterminal -e "~/path with space/testbin.sh" "some string with       whitespace"

results in

("~/path", "with", "space", "testbin.sh", "some", "string", "with", "whitespace")

instead of

("~/path with space/testbin.sh" "some string with       whitespace")

@yan12125
Copy link
Member

yan12125 commented Mar 2, 2021

This looks like a duplicate of #335. Please leave a comment if I get it wrong, thanks!

@yan12125 yan12125 closed this as completed Mar 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants