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

Add option to change cursor shape on exit of ScreenInteractive loop #953

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions include/ftxui/component/screen_interactive.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ class ScreenInteractive : public Screen {
// Options. Must be called before Loop().
void TrackMouse(bool enable = true);

void SetCursorReset(Screen::Cursor::Shape shape);

// Return the currently active screen, nullptr if none.
static ScreenInteractive* Active();

Expand Down
5 changes: 5 additions & 0 deletions src/ftxui/component/screen_interactive.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -441,6 +441,11 @@ void ScreenInteractive::TrackMouse(bool enable) {
track_mouse_ = enable;
}

/// @brief Set cursor shape on exit of main loop
void ScreenInteractive::SetCursorReset(Screen::Cursor::Shape shape) {
cursor_reset_shape_ = shape;
}

/// @brief Add a task to the main loop.
/// It will be executed later, after every other scheduled tasks.
/// @ingroup component
Expand Down