You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Please give a brief but clear explanation of the issue. If you can, include a complete working example that demonstrates the bug. Check it can run without modifications.
As per title, the "Do you want to quit?" notification won't show when a ModalScreen is pushed to the top and ctrl+c is pressed.
This is reproduced using the ModalScreen doc example:
fromtextual.appimportApp, ComposeResultfromtextual.containersimportGridfromtextual.screenimportModalScreenfromtextual.widgetsimportButton, Footer, Header, LabelTEXT="""I must not fear.Fear is the mind-killer.Fear is the little-death that brings total obliteration.I will face my fear.I will permit it to pass over me and through me.And when it has gone past, I will turn the inner eye to see its path.Where the fear has gone there will be nothing. Only I will remain."""classQuitScreen(ModalScreen):
"""Screen with a dialog to quit."""defcompose(self) ->ComposeResult:
yieldGrid(
Label("Are you sure you want to quit?", id="question"),
Button("Quit", variant="error", id="quit"),
Button("Cancel", variant="primary", id="cancel"),
id="dialog",
)
defon_button_pressed(self, event: Button.Pressed) ->None:
ifevent.button.id=="quit":
self.app.exit()
else:
self.app.pop_screen()
classModalApp(App):
"""An app with a modal dialog."""CSS_PATH="modal01.tcss"BINDINGS= [("q", "request_quit", "Quit")]
defcompose(self) ->ComposeResult:
yieldHeader()
yieldLabel(TEXT*8)
yieldFooter()
defaction_request_quit(self) ->None:
"""Action to display the quit dialog."""self.push_screen(QuitScreen())
if__name__=="__main__":
app=ModalApp()
app.run()
Note that the same problem does not happen when pushing Screen (in place of ModalScreen).
Diagnostic output:
<!-- This is valid Markdown, please paste the following directly in to a GitHub issue -->
# Textual Diagnostics
## Versions
| Name | Value |
|---------|--------|
| Textual | 1.0.0 |
| Rich | 13.9.4 |
## Python
| Name | Value |
|----------------|-------------------------------------------------------|
| Version | 3.11.11 |
| Implementation | CPython |
| Compiler | Clang 14.0.6 |
| Executable | /Users/peppedilillo/anaconda3/envs/misfits/bin/python |
## Operating System
| Name | Value |
|---------|-------------------------------------------------------------------------------------------------------|
| System | Darwin |
| Release | 24.2.0 |
| Version | Darwin Kernel Version 24.2.0: Fri Dec 6 18:40:14 PST 2024; root:xnu-11215.61.5~2/RELEASE_ARM64_T8103 |
## Terminal
| Name | Value |
|----------------------|-----------------|
| Terminal Application | ghostty (1.0.1) |
| TERM | xterm-ghostty |
| COLORTERM | truecolor |
| FORCE_COLOR | *Not set* |
| NO_COLOR | *Not set* |
## Rich Console options
| Name | Value |
|----------------|---------------------|
| size | width=88, height=28 |
| legacy_windows | False |
| min_width | 1 |
| max_width | 88 |
| is_terminal | False |
| encoding | utf-8 |
| max_height | 28 |
| justify | None |
| overflow | None |
| no_wrap | False |
| highlight | None |
| markup | None |
| height | None |
The text was updated successfully, but these errors were encountered:
yes
yes, tested on textual 1.0.0.
As per title, the "Do you want to quit?" notification won't show when a
ModalScreen
is pushed to the top and ctrl+c is pressed.This is reproduced using the ModalScreen doc example:
Note that the same problem does not happen when pushing
Screen
(in place ofModalScreen
).Diagnostic output:
The text was updated successfully, but these errors were encountered: