Skip to content

Add exit button#573

Merged
IgorTatarnikov merged 7 commits into
mainfrom
add_exit_button
Aug 20, 2025
Merged

Add exit button#573
IgorTatarnikov merged 7 commits into
mainfrom
add_exit_button

Conversation

@JoeZiminski
Copy link
Copy Markdown
Member

@JoeZiminski JoeZiminski commented Aug 6, 2025

This PR closes #545 by adding an 'Exit' button to the main window. I tried to use CTRL+C for copy directly, but forgot that in some cases this still quits the application on Windows. I think under certain conditions the textual event loop is in a strange / awaiting state and the CTRL+C is not caught, defaulting to windows behavior which is to exit the application (also encountered in #458).

As such, CTRL+Q is maintained for copy. However now, CTRL+C does not exit the application, but causes a popup with the following information:

      self.notify(
          "Use CTRL+Q to copy from Inputs and DirectoryTrees.\n"
          "Use ESC or the 'Exit' button to quit the application.\n"
          "CTRL+C can be used to copy after highlighting text with the mouse while pressing 'shift'.",
          timeout=6,
      )

This is because I think it might be annoying if you were trying to copy for the application to exit. It also lets the user know about a cool trick that if you select while holding shift, you can copy any text (found by @cs7-shrey).

Copy link
Copy Markdown
Member

@IgorTatarnikov IgorTatarnikov left a comment

Choose a reason for hiding this comment

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

Looks great! Is it worth adding a warning when Esc is hit? I worry about incidental key pushes leading to an unexpected exit.

``datashuttle`` with our [Getting Started Tutorial](getting-started-walkthrough).

To quit ``datashuttle`` in the terminal, press `CTRL+C`.
To quit ``datashuttle`` in the terminal, press `CTRL+Q`.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Should this be Esc?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

thanks good catch!

@JoeZiminski
Copy link
Copy Markdown
Member Author

Good point, do you think CTRL+ESC would be weird? Otherwise a warning pop-up window is definitely dooable, I think I am just being lazy 😅

@IgorTatarnikov
Copy link
Copy Markdown
Member

Ctrl+ESC would work but a pop-up might be nice for the future! Maybe change to Ctrl + Esc for now and open an issue to make a pop-up in the future.

@JoeZiminski
Copy link
Copy Markdown
Member Author

Hey @IgorTatarnikov in the end I added the warning window, it was pretty quick! If you could take a quick look whenever you have time that would be great. Cheers!

Copy link
Copy Markdown
Member

@IgorTatarnikov IgorTatarnikov left a comment

Choose a reason for hiding this comment

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

Works great! The confirmation popup is a great addition.

@IgorTatarnikov IgorTatarnikov merged commit 1aa905e into main Aug 20, 2025
16 checks passed
@IgorTatarnikov IgorTatarnikov deleted the add_exit_button branch August 20, 2025 13:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Clearer instructions for exiting TUI

2 participants