mouse sending random characters to the terminal after examples/minimal ends
wmarini opened this issue · 8 comments
Hello! I compiled the latest commit on my Ubuntu 22.04.3 Linux machine. After compiling, I found an issue with the "examples/minimal" program. When it finishes running, the mouse causes the terminal to display random characters when one of its button is pressed.
See below how to reproduce this issue:
$ git log -n 1 --oneline
$ git status
# moving to the `build` directory
$ cd ../build/cpp-terminal-master
$ cmake --build . --target clean
$ cmake --build .
$ examples/minimal
Full output (before I lost control of the mouse in that terminal):
wmarini@mineta:~/installs/cpp-terminal$ git log -n 1 --oneline
6059c0d (HEAD -> master, origin/master, origin/HEAD) Update attach_console_minimal.cpp
wmarini@mineta:~/installs/cpp-terminal$ git status
On branch master
Your branch is up to date with 'origin/master'.
nothing to commit, working tree clean
wmarini@mineta:~/installs/cpp-terminal$ cd ../build/cpp-terminal-master
wmarini@mineta:~/installs/build/cpp-terminal-master$ cmake --build . --target clean
[2/2] Cleaning all built files...
Cleaning... 91 files.
wmarini@mineta:~/installs/build/cpp-terminal-master$ cmake --build .
[14/85] Building CXX object cpp-terminal/CMakeFiles/cpp-terminal.dir/event.cpp.o
/home/wmarini/installs/cpp-terminal/cpp-terminal/event.cpp: In member function ‘void Term::Event::parse(const string&)’:
/home/wmarini/installs/cpp-terminal/cpp-terminal/event.cpp:279:24: warning: ‘type’ may be used uninitialized in this function [-Wmaybe-uninitialized]
279 | Term::Button::Type type;
| ^~~~
[24/85] Building CXX object cpp-terminal/platforms/CMakeFiles/cpp-terminal-platforms.dir/sigwinch.cpp.o
/home/wmarini/installs/cpp-terminal/cpp-terminal/platforms/sigwinch.cpp: In static member function ‘static bool Term::Private::Sigwinch::isSigwinch(const int&)’:
/home/wmarini/installs/cpp-terminal/cpp-terminal/platforms/sigwinch.cpp:101:11: warning: ignoring return value of ‘ssize_t read(int, void*, size_t)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
101 | ::read(m_fd, &fdsi, sizeof(fdsi));
| ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
[85/85] Linking CXX executable tests/Events
@wmarini could you tell me what terminal are you using ?
It's a gnome-terminal
.
$ echo $TERM
xterm-256color
$ echo $SHELL
/bin/bash
$ tty
/dev/pts/1
@wmarini could you tell me what terminal are you using ?
It's a
gnome-terminal
.$ echo $TERM xterm-256color $ echo $SHELL /bin/bash $ tty /dev/pts/1
Thx I did some basic test with this terminal. Most of the problem reported should be fixed. There is still corner cases but I need more time to investigate. But the last commits should solve the issue you posted
@wmarini could you tell me what terminal are you using ?
It's a
gnome-terminal
.$ echo $TERM xterm-256color $ echo $SHELL /bin/bash $ tty /dev/pts/1
Thx I did some basic test with this terminal. Most of the problem reported should be fixed. There is still corner cases but I need more time to investigate. But the last commits should solve the issue you posted
Yes, it 's fixed! A quick test with the last commit and that's working fine now! ;) Thank you!