Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/apps/desktop/src/api/terminal_api.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
//! Terminal API

use bitfun_core::infrastructure::PathManager;
use log::{error, warn};
use serde::{Deserialize, Serialize};
use std::path::PathBuf;
Expand Down Expand Up @@ -72,8 +73,8 @@ impl TerminalState {
/// Get the scripts directory path for shell integration
/// Uses the same path structure as PathManager
fn get_scripts_dir() -> PathBuf {
dirs::config_dir()
.unwrap_or_else(|| PathBuf::from("."))
PathManager::new().map(|p| p.home_dir())
.unwrap_or_else(|_| PathBuf::from("."))
.join("bitfun")
.join("temp")
.join("scripts")
Expand Down
20 changes: 10 additions & 10 deletions src/crates/core/src/service/terminal/src/shell/detection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,22 +82,21 @@ impl ShellDetector {

#[cfg(not(windows))]
{
if let Some(zsh_path) = Self::find_zsh_with_which() {
return DetectedShell {
shell_type: ShellType::Zsh,
path: zsh_path.clone(),
version: Self::get_shell_version(zsh_path.to_str().unwrap_or_default()),
display_name: "zsh".to_string(),
};
} else if let Some(bash_path) = Self::find_bash_with_which() {
if let Some(bash_path) = Self::find_bash_with_which() {
return DetectedShell {
shell_type: ShellType::Bash,
path: bash_path.clone(),
version: Self::get_shell_version(bash_path.to_str().unwrap_or_default()),
display_name: "bash".to_string(),
};
}
{
} else if let Some(zsh_path) = Self::find_zsh_with_which() {
return DetectedShell {
shell_type: ShellType::Zsh,
path: zsh_path.clone(),
version: Self::get_shell_version(zsh_path.to_str().unwrap_or_default()),
display_name: "zsh".to_string(),
};
} else {
log::error!("bash not found");
}
// Try to use $SHELL environment variable
Expand Down Expand Up @@ -304,6 +303,7 @@ impl ShellDetector {
PathBuf::from(format!("/usr/local/bin/{}", executable)),
PathBuf::from(format!("/usr/bin/{}", executable)),
PathBuf::from(format!("/bin/{}", executable)),
PathBuf::from(format!("/data/service/hnp/bin/{}", executable)),
];

for path in candidates {
Expand Down
Loading