From c65cab710bb3d79db20862c9361d4dbbac8ac5d7 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Thu, 25 Jun 2026 03:20:08 +0900 Subject: feat(php-shim): model $_ENV/$_SERVER as OsString snapshots Rework the environment shim around getenv/putenv on the real environment and $_ENV/$_SERVER as startup snapshots, all over OsString. Migrate every caller off the old server()/server_argv() helpers and force the snapshots in main() before any putenv() runs. Document the porting rules in docs/dev/env-vars-porting.md. Co-Authored-By: Claude Opus 4.8 (1M context) --- .../src/symfony/console/formatter/output_formatter_style.rs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'crates/shirabe-external-packages/src/symfony/console/formatter') diff --git a/crates/shirabe-external-packages/src/symfony/console/formatter/output_formatter_style.rs b/crates/shirabe-external-packages/src/symfony/console/formatter/output_formatter_style.rs index 39d694d..c421edf 100644 --- a/crates/shirabe-external-packages/src/symfony/console/formatter/output_formatter_style.rs +++ b/crates/shirabe-external-packages/src/symfony/console/formatter/output_formatter_style.rs @@ -77,13 +77,17 @@ impl OutputFormatterStyleInterface for OutputFormatterStyle { if self.handles_href_gracefully.is_none() { self.handles_href_gracefully = Some( shirabe_php_shim::getenv("TERMINAL_EMULATOR").as_deref() - != Some("JetBrains-JediTerm") + != Some(std::ffi::OsStr::new("JetBrains-JediTerm")) && (shirabe_php_shim::getenv("KONSOLE_VERSION").is_none_or(|v| v.is_empty()) || shirabe_php_shim::getenv("KONSOLE_VERSION") - .map(|v| v.parse::().unwrap_or(0)) + .map(|v| v.to_string_lossy().parse::().unwrap_or(0)) .unwrap_or(0) > 201100) - && !shirabe_php_shim::server_contains_key("IDEA_INITIAL_DIRECTORY"), + && shirabe_php_shim::PHP_SERVER + .lock() + .unwrap() + .get("IDEA_INITIAL_DIRECTORY") + .is_none(), ); } -- cgit v1.3.1