Skip to content

Terminal interface to find, download, and stream movies, TV shows, and live TV using local media players.

feat(tui): add /exit slash command and remove redundant open with action

Samir Hossains2111ed658589
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 872910c..2709d2e 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -3,6 +3,8 @@
## [Unreleased]
### Added
+- **`/exit` Slash Command (`src/tui/commands.rs`, `src/tui/app/search.rs`)**: Added `/exit` (with `/quit` and `/q` aliases) to the slash command engine, allowing users to cleanly exit the application and restore the terminal state directly from the search bar.
+- **Streamlined Playback & "Open With" Removal (`src/tui/`)**: Removed the redundant `[o] Open With` action and shortcuts from the Details footer, keyboard handlers, mouse hitboxes, and help dialogs in favor of configuring default media players (`mpv`, `VLC`, `IINA`, `Android`) directly in the Settings Hub (`/settings`).
- **Unified `f` Shortcut for Favorites (`src/tui/app/keyboard.rs`, `src/tui/screens/help.rs`)**: Standardized favorite / unfavorite toggling across all screens exclusively to `f` / `F`, removing redundant `*` keybindings and streamlining in-app help overlays and documentation.
- **Responsive Details Screen Layout & Narrow Terminal Polish (`src/tui/screens/details.rs`, `src/tui/app/mouse.rs`)**:
- **Narrow-Screen Dynamic Selector Pane Focus**: On compact terminal widths (<85 columns), renders the active selector pane (Audio, Seasons, or Episodes) with 100% available horizontal width instead of horizontally cramming 3 unreadable 14-character columns that cut off titles, language names, and season numbers.
diff --git a/docs/controls.md b/docs/controls.md
index e803dca..69af5b1 100644
--- a/docs/controls.md
+++ b/docs/controls.md
@@ -61,7 +61,6 @@ All popup dialogs (Theme picker, Browse categories, Player picker, TV Manager, A
- **`Ctrl+P`**: Cycle content providers (`MovieBox` $\to$ `4KHDHub` $\to$ `BDIX`).
- **`←` / `→` / `h` / `l` / `Tab` / `Shift+Tab`**: Switch Details screen selector panes (Audio Languages, Seasons, Episodes, Streams).
- **`Enter`**: Play with default player.
-- **`o`**: Open player selection picker for the current stream.
- **`d`**: Download current episode or full season batch.
- **`r`**: Refresh search results / stream list.
- **`f`**: Favorite / unfavorite the selected title (Home & Details screens).
@@ -73,16 +72,13 @@ All popup dialogs (Theme picker, Browse categories, Player picker, TV Manager, A
- **`/clear`**: Clear active search query and return to landing.
### Live TV Mode
-- **`Enter`**: Play selected TV channel immediately.
-- **`o`**: Open player selection picker for the channel.
+- **`Enter`**: Play selected TV channel immediately with default player.
- **`r`**: Reload all active M3U playlist sources.
- **`/config`**: Open TV Playlist Manager dialog (`Space` to activate, `Delete`/`d` to remove).
- **`/list`**: Show all loaded channels.
### Addon Mode (HTTP Addons)
- **`Ctrl+P` / `/config`**: Open Addon Manager dialog (`Space` to toggle, `Delete`/`d` to remove).
-- **`←` / `→` / `h` / `l` / `Tab` / `Shift+Tab`**: Switch Details screen selector panes (Seasons, Episodes, Streams).
- **`Enter`**: Select title or play resolved stream.
-- **`o`**: Open player selection picker for the stream.
- **`d`**: Download HTTP stream release.
- **`r`**: Refresh addon catalog search results.
- **`f`**: Favorite / unfavorite the selected title (Home & Details screens).
@@ -126,6 +122,7 @@ Type these commands directly into the search bar:
| `/toggle-update` | All | Toggle automatic update checks on startup |
| `/toggle-bdix` | Streaming | Toggle BDIX FTP scrapers on/off |
| `/toggle-streaming` | All | Toggle Streaming Mode content availability |
+| `/exit` | All | Exit application and return to shell (aliases `/quit`, `/q`) |
| `/toggle-tv` | All | Toggle TV Mode IPTV player |
| `/toggle-addons` | All | Toggle Addon Mode HTTP metadata/stream extensions |
| `/probe` | All | Re-probe terminal graphics protocol support (Kitty, Sixel, iTerm2) |
diff --git a/src/tui/action.rs b/src/tui/action.rs
index 57ea0d0..24328c4 100644
--- a/src/tui/action.rs
+++ b/src/tui/action.rs
@@ -69,8 +69,8 @@ pub enum Action {
FetchPreview(String),
PreviewSuccess(u64, String, serde_json::Value),
PreviewFailure(u64, String),
- PlayStream(bool),
- ShowSubtitlePopup(String, serde_json::Value, bool),
+ PlayStream,
+ ShowSubtitlePopup(String, serde_json::Value),
ShowDownloadSubtitlePopup(serde_json::Value),
ToggleThemePopup,
SelectTheme(String),
diff --git a/src/tui/app/keyboard.rs b/src/tui/app/keyboard.rs
index 29d1de5..e7319ed 100644
--- a/src/tui/app/keyboard.rs
+++ b/src/tui/app/keyboard.rs
@@ -915,19 +915,6 @@ impl App {
self.state.input_mode = InputMode::Normal;
self.state.set_status_default("Search cleared.");
}
- KeyCode::Char('o') | KeyCode::Char('O')
- if self.state.input_mode == InputMode::Normal
- && self.state.is_tv_mode =>
- {
- let idx_opt = self.state.search_list_state.selected();
- if let Some(idx) = idx_opt {
- if let Some(item) = self.state.search_results.get(idx) {
- self.action_sender
- .send(Action::ShowPlayerPicker(item.id.clone(), None))
- .ok();
- }
- }
- }
KeyCode::Char('f') | KeyCode::Char('F')
if self.state.favorites_available()
&& (!self.state.search_results.is_empty()
@@ -1017,12 +1004,9 @@ impl App {
&& !self.state.show_season_download_confirm
&& !self.state.show_episode_download_confirm
{
- let open_with = key
- .modifiers
- .contains(crossterm::event::KeyModifiers::SHIFT);
match self.state.details_pane {
crate::tui::state::DetailsPane::Streams => {
- self.action_sender.send(Action::PlayStream(open_with)).ok();
+ self.action_sender.send(Action::PlayStream).ok();
}
crate::tui::state::DetailsPane::Seasons => {
self.trigger_episode_fetch();
@@ -1041,14 +1025,6 @@ impl App {
KeyCode::Char('q') => {
self.action_sender.send(Action::Quit).ok();
}
- KeyCode::Char('o') | KeyCode::Char('O') => {
- if !self.state.subtitle_popup && !self.state.player_picker_popup {
- if let crate::tui::state::DetailsPane::Streams = self.state.details_pane
- {
- self.action_sender.send(Action::PlayStream(true)).ok();
- }
- }
- }
KeyCode::Char('d') | KeyCode::Char('D') => {
if !self.state.subtitle_popup && !self.state.player_picker_popup {
if let crate::tui::state::DetailsPane::Seasons = self.state.details_pane
@@ -1120,9 +1096,6 @@ impl App {
}
}
KeyCode::Enter => {
- let open_with = key
- .modifiers
- .contains(crossterm::event::KeyModifiers::SHIFT);
if self.state.show_season_download_confirm {
if self.state.season_download_confirm_yes_selected {
self.action_sender.send(Action::ConfirmDownloadSeason).ok();
@@ -1143,7 +1116,7 @@ impl App {
} else {
match self.state.details_pane {
crate::tui::state::DetailsPane::Streams => {
- self.action_sender.send(Action::PlayStream(open_with)).ok();
+ self.action_sender.send(Action::PlayStream).ok();
}
crate::tui::state::DetailsPane::Seasons => {
self.trigger_episode_fetch();
diff --git a/src/tui/app/mouse.rs b/src/tui/app/mouse.rs
index 7a60d56..c5d2387 100644
--- a/src/tui/app/mouse.rs
+++ b/src/tui/app/mouse.rs
@@ -1010,7 +1010,7 @@ impl App {
} else if !self.state.is_resolving_playback
&& self.state.last_playback_launch.elapsed().as_millis() >= 500
{
- self.action_sender.send(Action::PlayStream(false)).ok();
+ self.action_sender.send(Action::PlayStream).ok();
}
}
}
@@ -1060,7 +1060,6 @@ impl App {
enum FooterAction {
PlaySelect,
- OpenWith,
Download,
Favorite,
Subtitles,
@@ -1073,11 +1072,8 @@ impl App {
if is_streams {
primary.push((FooterAction::PlaySelect, 7 + 1 + 4));
- let o_label_len = if compact { 4 } else { 9 };
- primary.push((FooterAction::OpenWith, 3 + 1 + o_label_len));
let d_label_len = if compact { 4 } else { 8 };
primary.push((FooterAction::Download, 3 + 1 + d_label_len));
-
secondary.push((FooterAction::Favorite, 3 + 1 + fav_label_len));
if !self.state.subtitle_list.is_empty() {
let s_label_len = if compact { 4 } else { 9 };
@@ -1135,14 +1131,11 @@ impl App {
match action {
FooterAction::PlaySelect => {
if is_streams {
- self.action_sender.send(Action::PlayStream(false)).ok();
+ self.action_sender.send(Action::PlayStream).ok();
} else {
self.action_sender.send(Action::Submit).ok();
}
}
- FooterAction::OpenWith => {
- self.action_sender.send(Action::PlayStream(true)).ok();
- }
FooterAction::Download => {
if is_seasons {
self.action_sender.send(Action::PromptDownloadSeason).ok();
diff --git a/src/tui/app/navigation.rs b/src/tui/app/navigation.rs
index 4d06002..1185ab2 100644
--- a/src/tui/app/navigation.rs
+++ b/src/tui/app/navigation.rs
@@ -769,16 +769,9 @@ impl App {
let idx = self.state.subtitle_list_state.selected().unwrap_or(0);
let sub_url = self.state.subtitle_list.get(idx).map(|(_, u)| u.clone());
if let Some(link) = self.state.pending_play_link.take() {
- let open_with = self.state.pending_open_with;
- if open_with {
- self.action_sender
- .send(Action::ShowPlayerPicker(link, sub_url))
- .ok();
- } else {
- self.action_sender
- .send(Action::LaunchMpv(link, sub_url))
- .ok();
- }
+ self.action_sender
+ .send(Action::LaunchMpv(link, sub_url))
+ .ok();
}
return None;
} else if self.state.is_download_subtitle_popup {
diff --git a/src/tui/app/playback.rs b/src/tui/app/playback.rs
index b047df8..643c925 100644
--- a/src/tui/app/playback.rs
+++ b/src/tui/app/playback.rs
@@ -320,7 +320,7 @@ fn clean_player_error(code: Option<i32>, stderr: &str) -> String {
impl App {
pub(super) async fn handle_playback(&mut self, action: Action) -> Option<()> {
match action {
- Action::PlayStream(open_with) => {
+ Action::PlayStream => {
if self.state.is_playing {
self.state.notify(
NotificationKind::Warning,
@@ -369,13 +369,13 @@ impl App {
|| release.provider == ProviderKind::BdixDhakaFlix
{
let sender_clone = self.action_sender.clone();
- if open_with || default_player.is_none() {
+ if let Some(player) = default_player {
sender_clone
- .send(Action::ShowPlaybackPicker(direct_source))
+ .send(Action::LaunchPlayback(player, direct_source))
.ok();
- } else if let Some(player) = default_player {
+ } else {
sender_clone
- .send(Action::LaunchPlayback(player, direct_source))
+ .send(Action::ShowPlaybackPicker(direct_source))
.ok();
}
return None;
@@ -409,10 +409,10 @@ impl App {
&source.headers,
)
});
- if open_with || default_player.is_none() {
- sender.send(Action::ShowPlaybackPicker(source)).ok();
- } else if let Some(player) = default_player {
+ if let Some(player) = default_player {
sender.send(Action::LaunchPlayback(player, source)).ok();
+ } else {
+ sender.send(Action::ShowPlaybackPicker(source)).ok();
}
}
Ok(Err(error)) => {
@@ -468,11 +468,7 @@ impl App {
.flatten();
if let Some(res) = cached {
sender
- .send(Action::ShowSubtitlePopup(
- link_clone.clone(),
- res,
- open_with,
- ))
+ .send(Action::ShowSubtitlePopup(link_clone.clone(), res))
.ok();
return;
}
@@ -493,35 +489,21 @@ impl App {
&res_for_cache,
);
});
- sender
- .send(Action::ShowSubtitlePopup(link_clone, res, open_with))
- .ok();
+ sender.send(Action::ShowSubtitlePopup(link_clone, res)).ok();
}
_ => {
- if open_with {
- sender
- .send(Action::ShowPlayerPicker(link_clone, None))
- .ok();
- } else {
- sender.send(Action::LaunchMpv(link_clone, None)).ok();
- }
+ sender.send(Action::LaunchMpv(link_clone, None)).ok();
}
}
});
} else {
- if open_with {
- self.action_sender
- .send(Action::ShowPlayerPicker(link, None))
- .ok();
- } else {
- self.action_sender.send(Action::LaunchMpv(link, None)).ok();
- }
+ self.action_sender.send(Action::LaunchMpv(link, None)).ok();
}
} else {
self.state.is_resolving_playback = false;
}
}
- Action::ShowSubtitlePopup(link, ext_captions, open_with) => {
+ Action::ShowSubtitlePopup(link, ext_captions) => {
self.state.is_resolving_playback = false;
let options = crate::tui::state::caption_options(&ext_captions);
@@ -533,15 +515,8 @@ impl App {
self.state.subtitle_list = options;
self.state.subtitle_list_state.select(Some(0));
self.state.pending_play_link = Some(link);
- self.state.pending_open_with = open_with;
} else {
- if open_with {
- self.action_sender
- .send(Action::ShowPlayerPicker(link, None))
- .ok();
- } else {
- self.action_sender.send(Action::LaunchMpv(link, None)).ok();
- }
+ self.action_sender.send(Action::LaunchMpv(link, None)).ok();
}
}
Action::ShowDownloadSubtitlePopup(ext_captions) => {
@@ -752,7 +727,6 @@ mod tests {
app.handle_playback(crate::tui::action::Action::ShowSubtitlePopup(
"https://example.com/video.mp4".to_string(),
ext_captions,
- false,
))
.await;
diff --git a/src/tui/app/requests.rs b/src/tui/app/requests.rs
index 6d2035c..2a6e60a 100644
--- a/src/tui/app/requests.rs
+++ b/src/tui/app/requests.rs
@@ -1404,7 +1404,7 @@ impl App {
self.state.is_fetching_streams = false;
if self.state.auto_play_on_ready {
self.state.auto_play_on_ready = false;
- self.action_sender.send(Action::PlayStream(false)).ok();
+ self.action_sender.send(Action::PlayStream).ok();
}
return None;
}
@@ -2024,7 +2024,7 @@ impl App {
}
if self.state.auto_play_on_ready {
self.state.auto_play_on_ready = false;
- self.action_sender.send(Action::PlayStream(false)).ok();
+ self.action_sender.send(Action::PlayStream).ok();
}
}
diff --git a/src/tui/app/run.rs b/src/tui/app/run.rs
index fdbf8aa..c84bd0f 100644
--- a/src/tui/app/run.rs
+++ b/src/tui/app/run.rs
@@ -458,7 +458,7 @@ impl App {
self.handle_requests(action).await;
}
- Action::PlayStream(..)
+ Action::PlayStream
| Action::ShowSubtitlePopup(..)
| Action::ShowDownloadSubtitlePopup(..)
| Action::ShowPlaybackPicker(..)
diff --git a/src/tui/app/search.rs b/src/tui/app/search.rs
index 0b60336..f51e850 100644
--- a/src/tui/app/search.rs
+++ b/src/tui/app/search.rs
@@ -142,6 +142,10 @@ impl App {
}
match parsed {
+ crate::tui::commands::ParsedCommand::Exit => {
+ self.action_sender.send(Action::Quit).ok();
+ Some(true)
+ }
crate::tui::commands::ParsedCommand::Settings => {
self.action_sender.send(Action::ToggleSettingsPopup).ok();
Some(true)
diff --git a/src/tui/commands.rs b/src/tui/commands.rs
index 7498b74..c751b89 100644
--- a/src/tui/commands.rs
+++ b/src/tui/commands.rs
@@ -21,6 +21,7 @@ pub enum SlashCommand {
ToggleTv,
ToggleAddons,
Probe,
+ Exit,
}
#[derive(Debug, Clone, PartialEq, Eq)]
@@ -44,10 +45,11 @@ pub enum ParsedCommand<'a> {
ToggleTv,
ToggleAddons,
Probe,
+ Exit,
}
impl SlashCommand {
- pub const ALL: [Self; 19] = [
+ pub const ALL: [Self; 20] = [
Self::Settings,
Self::Browse,
Self::History,
@@ -67,6 +69,7 @@ impl SlashCommand {
Self::ToggleTv,
Self::ToggleAddons,
Self::Probe,
+ Self::Exit,
];
pub const PRIMARY: [Self; 7] = [
@@ -108,6 +111,7 @@ impl SlashCommand {
Self::ToggleTv => "/toggle-tv",
Self::ToggleAddons => "/toggle-addons",
Self::Probe => "/probe",
+ Self::Exit => "/exit",
}
}
@@ -140,6 +144,7 @@ impl SlashCommand {
Self::ToggleTv => "Toggle TV mode navigation",
Self::ToggleAddons => "Toggle Addon mode navigation",
Self::Probe => "Re-detect terminal graphics support",
+ Self::Exit => "Exit application and restore terminal",
}
}
@@ -169,7 +174,8 @@ impl SlashCommand {
| Self::ToggleStreaming
| Self::ToggleTv
| Self::ToggleAddons
- | Self::Probe => true,
+ | Self::Probe
+ | Self::Exit => true,
}
}
@@ -249,6 +255,7 @@ impl SlashCommand {
"/toggle-tv" => Some(Self::ToggleTv.description(state)),
"/toggle-addons" => Some(Self::ToggleAddons.description(state)),
"/probe" => Some(Self::Probe.description(state)),
+ "/exit" | "/quit" | "/q" => Some(Self::Exit.description(state)),
_ => None,
}
}
@@ -287,6 +294,7 @@ impl SlashCommand {
Some(ParsedCommand::ToggleAddons)
}
"/probe" => Some(ParsedCommand::Probe),
+ "/exit" | "/quit" | "/q" => Some(ParsedCommand::Exit),
_ => None,
}
}
@@ -347,7 +355,12 @@ mod tests {
#[test]
fn test_toggle_commands_and_aliases_parse() {
let state = AppState::default();
- assert_eq!(SlashCommand::ALL.len(), 19);
+ assert_eq!(SlashCommand::ALL.len(), 20);
+ assert_eq!(SlashCommand::parse("/exit"), Some(ParsedCommand::Exit));
+ assert_eq!(SlashCommand::parse("/quit"), Some(ParsedCommand::Exit));
+ assert_eq!(SlashCommand::parse("/q"), Some(ParsedCommand::Exit));
+ assert!(SlashCommand::Exit.is_available(&state));
+ assert_eq!(SlashCommand::Exit.name(), "/exit");
assert_eq!(SlashCommand::parse("/clear"), Some(ParsedCommand::Clear));
assert!(SlashCommand::Clear.is_available(&state));
assert_eq!(SlashCommand::Clear.name(), "/clear");
diff --git a/src/tui/screens/details.rs b/src/tui/screens/details.rs
index 42d5224..a33b8a3 100644
--- a/src/tui/screens/details.rs
+++ b/src/tui/screens/details.rs
@@ -2048,12 +2048,6 @@ fn details_footer(
if is_streams {
primary.extend(footer_group("Enter", "Play", true, theme));
- primary.extend(footer_group(
- "o",
- if compact { "Open" } else { "Open With" },
- false,
- theme,
- ));
primary.extend(footer_group(
"d",
if compact { "Save" } else { "Download" },
@@ -2330,7 +2324,7 @@ mod tests {
all_spans.extend(secondary);
let footer_text: String = all_spans.iter().map(|s| s.content.as_ref()).collect();
assert!(footer_text.contains("[Enter] Play"));
- assert!(footer_text.contains("[o] Open With"));
+ assert!(!footer_text.contains("[o] Open With"));
assert!(footer_text.contains("[d] Download"));
assert!(footer_text.contains("[f] Favorite"));
assert!(footer_text.contains("[s] Subtitles"));
diff --git a/src/tui/screens/help.rs b/src/tui/screens/help.rs
index 302fa15..31a5c74 100644
--- a/src/tui/screens/help.rs
+++ b/src/tui/screens/help.rs
@@ -102,10 +102,6 @@ pub fn draw(frame: &mut Frame, area: Rect, state: &AppState, theme: &Theme) {
Span::styled(" [Enter] ", theme.header),
Span::styled("Play Selected Channel", theme.text),
]));
- help_text.push(Line::from(vec![
- Span::styled(" [o] ", theme.header),
- Span::styled("Open Alternative Player Picker", theme.text),
- ]));
help_text.push(Line::from(vec![
Span::styled(" [r] ", theme.header),
Span::styled("Reload TV Playlists", theme.text),
@@ -131,14 +127,6 @@ pub fn draw(frame: &mut Frame, area: Rect, state: &AppState, theme: &Theme) {
Span::styled(" [←] [→] / [Tab]", theme.header),
Span::styled("Switch Details Pane (Seasons/Streams)", theme.text),
]));
- help_text.push(Line::from(vec![
- Span::styled(" [Enter] ", theme.header),
- Span::styled("Select Movie / Play Stream", theme.text),
- ]));
- help_text.push(Line::from(vec![
- Span::styled(" [o] ", theme.header),
- Span::styled("Open Alternative Player Picker", theme.text),
- ]));
help_text.push(Line::from(vec![
Span::styled(" [d] ", theme.header),
Span::styled("Download Video Stream", theme.text),
@@ -183,14 +171,6 @@ pub fn draw(frame: &mut Frame, area: Rect, state: &AppState, theme: &Theme) {
Span::styled(" [←] [→] / [Tab]", theme.header),
Span::styled("Switch Details Pane (Audio/Seasons/Streams)", theme.text),
]));
- help_text.push(Line::from(vec![
- Span::styled(" [Enter] ", theme.header),
- Span::styled("Play with Default Player", theme.text),
- ]));
- help_text.push(Line::from(vec![
- Span::styled(" [o] ", theme.header),
- Span::styled("Open Alternative Player Picker", theme.text),
- ]));
help_text.push(Line::from(vec![
Span::styled(" [d] ", theme.header),
Span::styled("Download Episode / Season Batch", theme.text),
@@ -239,6 +219,10 @@ pub fn draw(frame: &mut Frame, area: Rect, state: &AppState, theme: &Theme) {
Span::styled(" /clear ", theme.header),
Span::styled("Clear Search & Return to Landing", theme.text),
]));
+ help_text.push(Line::from(vec![
+ Span::styled(" /exit ", theme.header),
+ Span::styled("Exit Application and Return to Shell", theme.text),
+ ]));
help_text.push(Line::from(vec![
Span::styled(" /help ", theme.header),
Span::styled("Toggle Interactive Help Menu", theme.text),
diff --git a/tests/error_handling.rs b/tests/error_handling.rs
index 1f2507a..c89aa6a 100644
--- a/tests/error_handling.rs
+++ b/tests/error_handling.rs
@@ -125,7 +125,7 @@ async fn test_rapid_playback_invocations_debounced_and_single_flight() {
app.state_mut().last_playback_launch = std::time::Instant::now();
app.state_mut().is_resolving_playback = false;
- let res = app.handle_action(Action::PlayStream(false)).await;
+ let res = app.handle_action(Action::PlayStream).await;
assert_eq!(res, None);
assert!(!app.state().is_resolving_playback);
}
@@ -135,7 +135,7 @@ async fn test_active_player_session_blocks_duplicate_playback_and_recovers_on_ex
let mut app = App::new();
app.state_mut().is_playing = true;
- let res = app.handle_action(Action::PlayStream(false)).await;
+ let res = app.handle_action(Action::PlayStream).await;
assert_eq!(res, None);
assert!(!app.state().notifications.is_empty());
let notif = app.state().notifications.back().unwrap();