Skip to content

Commit

Permalink
Merge pull request #1553 from contour-terminal/fix/win32-ConPTY-TERM-…
Browse files Browse the repository at this point in the history
…envvar

Do not export TERM env var when using ConPTY (on Windows)
  • Loading branch information
christianparpart authored Jul 1, 2024
2 parents 2a7014a + 9097caa commit d527447
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 2 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -494,10 +494,12 @@ jobs:
uses: lukka/run-vcpkg@v11.1
id: runvcpkg
with:
vcpkgDirectory: ${{ runner.workspace }}/vcpkg/
vcpkgDirectory: ${{ runner.workspace }}/vcpkg
vcpkgGitCommitId: 80403036a665cb8fcc1a1b3e17593d20b03b2489
- name: "Generate build files"
run: cmake --preset windows-cl-release
env:
VCPKG_ROOT: "${{ runner.workspace }}/vcpkg"
- name: "Build"
run: cmake --build --preset windows-cl-release
- name: "Test"
Expand Down
2 changes: 1 addition & 1 deletion cmake/presets/os-windows.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"CMAKE_INSTALL_PREFIX": "${sourceDir}/out/install/${presetName}",
"CMAKE_SYSTEM_VERSION": "10",
"CMAKE_VERBOSE_MAKEFILE": "ON",
"CMAKE_TOOLCHAIN_FILE": "${sourceDir}/../vcpkg/scripts/buildsystems/vcpkg.cmake"
"CMAKE_TOOLCHAIN_FILE": "$env{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake"
}
},
{ "name": "windows-cl-debug", "inherits": ["windows-common", "debug"], "displayName": "Windows (MSVC) Debug", "description": "Using MSVC compiler (64-bit)" },
Expand Down
1 change: 1 addition & 0 deletions metainfo.xml
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@
<li>Add customizable per-input-mode default text/background coloring for indicator statusline (#1528)</li>
<li>Update of contour.desktop file (#1423)</li>
<li>Changed configuration entry values for `font_locator` down to `native` and `mock` only (#1538).</li>
<li>Do not export the `TERM` environment variable on Windows OS (when using ConPTY).</li>
<li>Fixes forwarding of input while in normal mode (#1468)</li>
<li>Fixes OSC-8 link id collision (#1499)</li>
<li>Fixed overlap of glyphs for long codepoints (#1349)</li>
Expand Down
9 changes: 9 additions & 0 deletions src/vtpty/Process_win32.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,15 @@ namespace
{
for (auto const& env: newValues)
{
if (env.first == "TERM")
{
// Do not pass TERM to child process, as it might cause problems with some applications
// (e.g. git diff) We are currently only using ConPTY here which does not require TERM to
// be set.
errorLog()("Ignoring TERM environment variable for child process.");
continue;
}

if (auto len = GetEnvironmentVariable(env.first.c_str(), nullptr, 0); len != 0)
{
vector<char> buf;
Expand Down

0 comments on commit d527447

Please sign in to comment.