terminal: Set TERM_PROGRAM
and TERM_PROGRAM_VERSION
environment variables in integrated terminal (#14213)
 These two environment variables are essential when people need to detect terminal type and do something. Many popular terminals set them. fixes https://github.com/zed-industries/zed/issues/4571 Release Notes: - Set `TERM_PROGRAM` and `TERM_PROGRAM_VERSION` environment variables in the integrated terminal ([#4571](https://github.com/zed-industries/zed/issues/4571)).
This commit is contained in:
parent
c195c4ddff
commit
d49727ff10
4 changed files with 10 additions and 1 deletions
1
Cargo.lock
generated
1
Cargo.lock
generated
|
@ -10737,6 +10737,7 @@ dependencies = [
|
||||||
"gpui",
|
"gpui",
|
||||||
"libc",
|
"libc",
|
||||||
"rand 0.8.5",
|
"rand 0.8.5",
|
||||||
|
"release_channel",
|
||||||
"schemars",
|
"schemars",
|
||||||
"serde",
|
"serde",
|
||||||
"serde_derive",
|
"serde_derive",
|
||||||
|
|
|
@ -180,6 +180,7 @@ impl Project {
|
||||||
settings.max_scroll_history_lines,
|
settings.max_scroll_history_lines,
|
||||||
window,
|
window,
|
||||||
completion_tx,
|
completion_tx,
|
||||||
|
cx,
|
||||||
)
|
)
|
||||||
.map(|builder| {
|
.map(|builder| {
|
||||||
let terminal_handle = cx.new_model(|cx| builder.subscribe(cx));
|
let terminal_handle = cx.new_model(|cx| builder.subscribe(cx));
|
||||||
|
|
|
@ -21,7 +21,7 @@ dirs.workspace = true
|
||||||
futures.workspace = true
|
futures.workspace = true
|
||||||
gpui.workspace = true
|
gpui.workspace = true
|
||||||
libc.workspace = true
|
libc.workspace = true
|
||||||
task.workspace = true
|
release_channel.workspace = true
|
||||||
schemars.workspace = true
|
schemars.workspace = true
|
||||||
serde.workspace = true
|
serde.workspace = true
|
||||||
serde_derive.workspace = true
|
serde_derive.workspace = true
|
||||||
|
@ -29,6 +29,7 @@ serde_json.workspace = true
|
||||||
settings.workspace = true
|
settings.workspace = true
|
||||||
sysinfo.workspace = true
|
sysinfo.workspace = true
|
||||||
smol.workspace = true
|
smol.workspace = true
|
||||||
|
task.workspace = true
|
||||||
theme.workspace = true
|
theme.workspace = true
|
||||||
thiserror.workspace = true
|
thiserror.workspace = true
|
||||||
util.workspace = true
|
util.workspace = true
|
||||||
|
|
|
@ -319,12 +319,18 @@ impl TerminalBuilder {
|
||||||
max_scroll_history_lines: Option<usize>,
|
max_scroll_history_lines: Option<usize>,
|
||||||
window: AnyWindowHandle,
|
window: AnyWindowHandle,
|
||||||
completion_tx: Sender<()>,
|
completion_tx: Sender<()>,
|
||||||
|
cx: &mut AppContext,
|
||||||
) -> Result<TerminalBuilder> {
|
) -> Result<TerminalBuilder> {
|
||||||
// TODO: Properly set the current locale,
|
// TODO: Properly set the current locale,
|
||||||
env.entry("LC_ALL".to_string())
|
env.entry("LC_ALL".to_string())
|
||||||
.or_insert_with(|| "en_US.UTF-8".to_string());
|
.or_insert_with(|| "en_US.UTF-8".to_string());
|
||||||
|
|
||||||
env.insert("ZED_TERM".to_string(), "true".to_string());
|
env.insert("ZED_TERM".to_string(), "true".to_string());
|
||||||
|
env.insert("TERM_PROGRAM".to_string(), "zed".to_string());
|
||||||
|
env.insert(
|
||||||
|
"TERM_PROGRAM_VERSION".to_string(),
|
||||||
|
release_channel::AppVersion::global(cx).to_string(),
|
||||||
|
);
|
||||||
|
|
||||||
let pty_options = {
|
let pty_options = {
|
||||||
let alac_shell = match shell.clone() {
|
let alac_shell = match shell.clone() {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue