DevelopmentNodeEnvironment_MicrosoftVSCodeDependency_22NodeVersion_Bundle_Clean_Debug_ElectronProfile_EsbuildCompiler_Mountain/IPC/WindServiceHandlers/Terminal/TerminalHide.rs
1//! Hide a terminal panel without disposing the underlying PTY.
2//! The child process keeps running; subsequent `TerminalShow`
3//! reopens the same session. Mirrors
4//! `vscode.Terminal.hide()`.
5
6use std::sync::Arc;
7
8use CommonLibrary::Terminal::TerminalProvider::TerminalProvider;
9use serde_json::Value;
10
11use crate::{
12 IPC::WindServiceHandlers::Utilities::JsonValueHelpers::arg_u64,
13 RunTime::ApplicationRunTime::ApplicationRunTime,
14};
15
16pub async fn Fn(RunTime:Arc<ApplicationRunTime>, Arguments:Vec<Value>) -> Result<Value, String> {
17 let TerminalId = arg_u64(&Arguments, 0);
18
19 RunTime
20 .Environment
21 .HideTerminal(TerminalId)
22 .await
23 .map(|()| Value::Null)
24 .map_err(|Error| format!("terminal:hide failed: {}", Error))
25}