mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-25 02:58:56 +01:00
cli: when attaching, always print the connection link (#178445)
Fixes #178090
This commit is contained in:
@@ -73,6 +73,8 @@ pub fn get_default_user_agent() -> String {
|
||||
)
|
||||
}
|
||||
|
||||
const NO_COLOR_ENV: &str = "NO_COLOR";
|
||||
|
||||
lazy_static! {
|
||||
pub static ref TUNNEL_SERVICE_USER_AGENT: String =
|
||||
match std::env::var(TUNNEL_SERVICE_USER_AGENT_ENV_VAR) {
|
||||
@@ -101,5 +103,11 @@ lazy_static! {
|
||||
option_env!("VSCODE_CLI_SERVER_NAME_MAP").and_then(|s| serde_json::from_str(s).unwrap());
|
||||
|
||||
/// Whether i/o interactions are allowed in the current CLI.
|
||||
pub static ref IS_INTERACTIVE_CLI: bool = atty::is(atty::Stream::Stdin) && std::env::var(NONINTERACTIVE_VAR).is_err();
|
||||
pub static ref IS_A_TTY: bool = atty::is(atty::Stream::Stdin);
|
||||
|
||||
/// Whether i/o interactions are allowed in the current CLI.
|
||||
pub static ref COLORS_ENABLED: bool = *IS_A_TTY && std::env::var(NO_COLOR_ENV).is_err();
|
||||
|
||||
/// Whether i/o interactions are allowed in the current CLI.
|
||||
pub static ref IS_INTERACTIVE_CLI: bool = *IS_A_TTY && std::env::var(NONINTERACTIVE_VAR).is_err();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user