Skip to content

Commit

Permalink
Fix cmd running when selected is directory
Browse files Browse the repository at this point in the history
  • Loading branch information
jeevithakannan2 committed Sep 19, 2024
1 parent fee5732 commit ce41fe3
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions tui/src/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -502,12 +502,13 @@ impl AppState {
}

fn handle_enter(&mut self) {
if self.selected_commands.is_empty() {
// If no commands are selected, run the currently by pushing them into vector
if let Some(cmd) = self.get_selected_command() {
self.selected_commands.push(cmd);
if self.selected_item_is_cmd() {
// If no commands are selected, run the selected by pushing them into vector
if self.selected_commands.is_empty() {
if let Some(cmd) = self.get_selected_command() {
self.selected_commands.push(cmd);
}
}

let command = RunningCommand::new(self.selected_commands.clone());
self.spawn_float(command, 80, 80);
self.selected_commands.clear();
Expand Down

0 comments on commit ce41fe3

Please sign in to comment.