Skip to content
This repository was archived by the owner on Jan 9, 2026. It is now read-only.

Conversation

@JonasKs
Copy link
Owner

@JonasKs JonasKs commented Jun 24, 2024


This is a GitHub Workspaces test!

Related to #1

This pull request introduces scroll functionality to the terminal widget in the Skoglab/terminal-ai-ops project, enhancing user interaction by allowing them to navigate through terminal output.

  • AppState Modifications:

    • Adds a new field terminal_scroll to AppState to keep track of the scroll position within the terminal widget.
    • Initializes terminal_scroll to 0 in AppState::new, ensuring a default starting position at the top of the terminal output.
  • UI Service Enhancements:

    • Modifies the render method in UiService to incorporate scrolling logic, enabling the terminal widget to display content based on the current scroll position stored in AppState::terminal_scroll.
    • Updates the start method to handle key events for scrolling up and down. Specifically, pressing the up arrow decreases terminal_scroll by 1, and pressing the down arrow increases terminal_scroll by 1, allowing users to navigate through the terminal output.
    • Implements conditional logic to prevent terminal_scroll from decrementing below 0, ensuring that users cannot scroll past the beginning of the terminal output.

For more details, open the Copilot Workspace session.

};
let pseudo_terminal = PseudoTerminal::new(screen);
let pseudo_terminal = PseudoTerminal::new(screen)
.scroll((self.app_state.terminal_scroll, 0)); // Added scroll functionality based on AppState::terminal_scroll
Copy link
Owner Author

Choose a reason for hiding this comment

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

There's no .scroll function on the PsuedoTerminal Widget

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants