diff --git a/CHANGELOG.md b/CHANGELOG.md index f2aaeb4cd..1dbd60ea9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,6 +21,8 @@ ([#7749](https://github.com/mitmproxy/mitmproxy/pull/7749), @mhils) - Display local timezone in the Timing tab of mitmweb. ([#7804](https://github.com/mitmproxy/mitmproxy/pull/7804), @lups2000) +- Prevent showing the quit message in the console when no flows are available under specific configurations. + ([#7833](https://github.com/mitmproxy/mitmproxy/pull/7833), @lups2000) ## 25 May 2025: mitmproxy 12.1.1 diff --git a/mitmproxy/tools/console/flowview.py b/mitmproxy/tools/console/flowview.py index cb9c12ac9..ec942ece3 100644 --- a/mitmproxy/tools/console/flowview.py +++ b/mitmproxy/tools/console/flowview.py @@ -104,7 +104,12 @@ class FlowDetails(tabs.Tabs): ] self.show() else: - self.master.window.pop() + # Get the top window from the focus stack (the currently active view). + # If it's NOT the "flowlist", it's safe to pop back to the previous view. + if self.master.window.focus_stack().stack[-1] != "flowlist": + self.master.window.pop() + # If it is the "flowlist", we’re already at the main view with no flows to show. + # Popping now would close the last window and prompt app exit, so we remain on the empty flow list screen instead. def tab_http_request(self): flow = self.flow