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

[textinput] Clear the terminal screen on Ctrl+L #10078

Merged

Conversation

jalopezg-git
Copy link
Contributor

This pull request implements the Ctrl+L keybinding (clear terminal screen) in ROOT's textinput.

Changes or fixes:

  • Adds the Display::Clear() member function, which clears the visible part of the screen on a TTY and moves the cursor to the home position. For Windows, this requires to temporarily enable processing of VT control sequences.
  • Provide implementation for the kCmdClearScreen editor command.

Checklist:

  • tested changes locally

This PR fixes #10057.

Writes the `\033[2J\033[H` sequence to clear the visible part of the screen.
For Windows, this requires to temporarily enable processing of VT control
sequences.
@phsft-bot
Copy link
Collaborator

Starting build on ROOT-debian10-i386/cxx14, ROOT-performance-centos8-multicore/default, ROOT-ubuntu16/nortcxxmod, ROOT-ubuntu2004/soversion, mac1015/python3, mac11/cxx17, windows10/cxx14
How to customize builds

@bellenot
Copy link
Member

bellenot commented Mar 8, 2022

@jalopezg-r00t I'll have to make several tests, TerminalDisplayWin is very sensitive to this kind of change, and it might create many side effects...

@phsft-bot
Copy link
Collaborator

Build failed on mac11/cxx17.
Running on macphsft20.dyndns.cern.ch:/Users/sftnight/build/workspace/root-pullrequests-build
See console output.

Warnings:

  • [2022-03-08T20:08:35.657Z] /Users/sftnight/build/workspace/root-pullrequests-build/root/core/textinput/src/textinput/TerminalDisplayUnix.h:34:10: warning: 'Attach' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
  • [2022-03-08T20:08:35.657Z] /Users/sftnight/build/workspace/root-pullrequests-build/root/core/textinput/src/textinput/TerminalDisplayUnix.h:35:10: warning: 'Detach' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
  • [2022-03-08T20:08:35.657Z] /Users/sftnight/build/workspace/root-pullrequests-build/root/core/textinput/src/textinput/TerminalDisplayUnix.h:38:10: warning: 'MoveUp' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
  • [2022-03-08T20:08:35.657Z] /Users/sftnight/build/workspace/root-pullrequests-build/root/core/textinput/src/textinput/TerminalDisplayUnix.h:39:10: warning: 'MoveDown' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
  • [2022-03-08T20:08:35.657Z] /Users/sftnight/build/workspace/root-pullrequests-build/root/core/textinput/src/textinput/TerminalDisplayUnix.h:40:10: warning: 'MoveLeft' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
  • [2022-03-08T20:08:35.657Z] /Users/sftnight/build/workspace/root-pullrequests-build/root/core/textinput/src/textinput/TerminalDisplayUnix.h:41:10: warning: 'MoveRight' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
  • [2022-03-08T20:08:35.657Z] /Users/sftnight/build/workspace/root-pullrequests-build/root/core/textinput/src/textinput/TerminalDisplayUnix.h:43:10: warning: 'MoveFront' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
  • [2022-03-08T20:08:35.657Z] /Users/sftnight/build/workspace/root-pullrequests-build/root/core/textinput/src/textinput/TerminalDisplayUnix.h:44:10: warning: 'SetColor' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
  • [2022-03-08T20:08:35.657Z] /Users/sftnight/build/workspace/root-pullrequests-build/root/core/textinput/src/textinput/TerminalDisplayUnix.h:45:10: warning: 'WriteRawString' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
  • [2022-03-08T20:08:35.657Z] /Users/sftnight/build/workspace/root-pullrequests-build/root/core/textinput/src/textinput/TerminalDisplayUnix.h:46:10: warning: 'ActOnEOL' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]

And 12 more

@phsft-bot
Copy link
Collaborator

Build failed on mac1015/python3.
Running on macitois21.dyndns.cern.ch:/Users/sftnight/build/workspace/root-pullrequests-build
See console output.

Warnings:

  • [2022-03-08T20:38:36.877Z] /Volumes/HD2/build/workspace/root-pullrequests-build/root/core/textinput/src/textinput/TerminalDisplayUnix.h:34:10: warning: 'Attach' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
  • [2022-03-08T20:38:36.877Z] /Volumes/HD2/build/workspace/root-pullrequests-build/root/core/textinput/src/textinput/TerminalDisplayUnix.h:35:10: warning: 'Detach' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
  • [2022-03-08T20:38:36.877Z] /Volumes/HD2/build/workspace/root-pullrequests-build/root/core/textinput/src/textinput/TerminalDisplayUnix.h:38:10: warning: 'MoveUp' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
  • [2022-03-08T20:38:36.877Z] /Volumes/HD2/build/workspace/root-pullrequests-build/root/core/textinput/src/textinput/TerminalDisplayUnix.h:39:10: warning: 'MoveDown' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
  • [2022-03-08T20:38:36.877Z] /Volumes/HD2/build/workspace/root-pullrequests-build/root/core/textinput/src/textinput/TerminalDisplayUnix.h:40:10: warning: 'MoveLeft' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
  • [2022-03-08T20:38:36.877Z] /Volumes/HD2/build/workspace/root-pullrequests-build/root/core/textinput/src/textinput/TerminalDisplayUnix.h:41:10: warning: 'MoveRight' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
  • [2022-03-08T20:38:36.877Z] /Volumes/HD2/build/workspace/root-pullrequests-build/root/core/textinput/src/textinput/TerminalDisplayUnix.h:43:10: warning: 'MoveFront' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
  • [2022-03-08T20:38:36.877Z] /Volumes/HD2/build/workspace/root-pullrequests-build/root/core/textinput/src/textinput/TerminalDisplayUnix.h:44:10: warning: 'SetColor' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
  • [2022-03-08T20:38:36.877Z] /Volumes/HD2/build/workspace/root-pullrequests-build/root/core/textinput/src/textinput/TerminalDisplayUnix.h:45:10: warning: 'WriteRawString' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
  • [2022-03-08T20:38:36.878Z] /Volumes/HD2/build/workspace/root-pullrequests-build/root/core/textinput/src/textinput/TerminalDisplayUnix.h:46:10: warning: 'ActOnEOL' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]

And 12 more

@phsft-bot
Copy link
Collaborator

Starting build on ROOT-debian10-i386/cxx14, ROOT-performance-centos8-multicore/default, ROOT-ubuntu16/nortcxxmod, ROOT-ubuntu2004/soversion, mac1015/python3, mac11/cxx17, windows10/cxx14
How to customize builds

Copy link
Member

@bellenot bellenot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, at least on Windows 😉

@phsft-bot
Copy link
Collaborator

Build failed on windows10/cxx14.
Running on null:C:\build\workspace\root-pullrequests-build
See console output.

Failing tests:

@jalopezg-git
Copy link
Contributor Author

@phsft-bot build just on windows10/cxx14

@phsft-bot
Copy link
Collaborator

Starting build on windows10/cxx14
How to customize builds

@jalopezg-git jalopezg-git merged commit bf9c323 into root-project:master Mar 10, 2022
@jalopezg-git jalopezg-git deleted the textinput-clearscreen-ctrl+l branch March 10, 2022 00:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Capture CTRL+L in ROOT prompt to clear
3 participants