From fb56e64537de5f93786ed121f703da2a4105badc Mon Sep 17 00:00:00 2001 From: Ogulcan Celik Date: Mon, 8 Jun 2026 01:36:51 +0300 Subject: fix: improve windows pane behavior --- src/pane.rs | 38 +++++++++++++++++++++----------------- 1 file changed, 21 insertions(+), 17 deletions(-) (limited to 'src/pane.rs') diff --git a/src/pane.rs b/src/pane.rs index 32c8c181..b7a1f6c8 100644 --- a/src/pane.rs +++ b/src/pane.rs @@ -1047,6 +1047,7 @@ fn pane_shell_command_builder(shell_config: PaneShellConfig<'_>) -> io::Result bool { - #[cfg(windows)] - { - let name = Path::new(shell) - .file_name() - .and_then(std::ffi::OsStr::to_str) - .unwrap_or(shell) - .to_ascii_lowercase(); - matches!( - name.as_str(), - "powershell" | "powershell.exe" | "pwsh" | "pwsh.exe" - ) - } - #[cfg(not(windows))] - { - let _ = shell; - false - } + let name = Path::new(shell) + .file_name() + .and_then(std::ffi::OsStr::to_str) + .unwrap_or(shell) + .to_ascii_lowercase(); + matches!( + name.as_str(), + "powershell" | "powershell.exe" | "pwsh" | "pwsh.exe" + ) } +#[cfg(windows)] fn windows_powershell_cwd_prompt_wrapper() -> &'static str { r#"$global:__HERDR_ORIGINAL_PROMPT = if (Test-Path Function:\prompt) { (Get-Command prompt -CommandType Function).ScriptBlock } else { { "PS $($executionContext.SessionState.Path.CurrentLocation)$('>' * ($nestedPromptLevel + 1)) " } }; function global:prompt { try { if ($PWD.Provider.Name -eq 'FileSystem') { $uri = ([System.Uri]$PWD.ProviderPath).AbsoluteUri; [Console]::Write("$([char]27)]7;$uri$([char]7)") } } catch {}; & $global:__HERDR_ORIGINAL_PROMPT }"# } @@ -2004,6 +2004,10 @@ impl PaneRuntime { }) } + pub fn synchronized_output_active(&self) -> bool { + self.terminal.synchronized_output_active() + } + pub fn visible_text(&self) -> String { self.terminal.visible_text() } -- cgit v1.2.3