Skip to content

Reading/writing in the terminal #5

@JMLX42

Description

@JMLX42

Hello,

I need to be able to:

  1. write a string/a vector of chars to the terminal
  2. read the terminal

For 2., here is what I came up with:

fn read_terminal(&self) -> String {
        self.terminal_backend
            .last_content()
            .grid
            .iter_from(Point::new(Line(0), Column(0)))
            .map(|cell| cell.c)
            .collect::<String>()
    }

For 1., I think using TerminalBackend::process_command() is the right option, but BackendCommand is not exposed by lib.rs so this method cannot be called.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions