Skip to content

action_suspend_process leaves the terminal the raw state #6298

@candidtim

Description

@candidtim

App.action_suspend_process suspends the app but the terminal appears to be in a raw state: all input is echoed but nothing else happens, there is no shell prompt, input is not processed in any other way.

The example code is taken directly from the documentation: https://textual.textualize.io/guide/app/#suspending-from-foreground . Running this code reproduces the issue. A copy of this code is below, but this is really taken from the doc.

I have also tried resetting the terminal settings with termios.tcsetattr to no avail, so I am not sure if this is really just the raw mode. There is no shell prompt, so looks like the terminal is owned by python process.

from textual.app import App, ComposeResult
from textual.binding import Binding
from textual.widgets import Label


class SuspendKeysApp(App[None]):

    BINDINGS = [Binding("ctrl+z", "suspend_process")]

    def compose(self) -> ComposeResult:
        yield Label("Press Ctrl+Z to suspend!")


if __name__ == "__main__":
    SuspendKeysApp().run()

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions