8af3f583c2776f5b5ab1d1c2ec1bb2e00f151f74
Closes #22657 Closes #37863 # Background Several users have noted that the terminal shipped with Zed on Windows is either misbehaving or missing several features including lack of consistent clearing behaviour. After some investigation which included digging into the Microsoft Terminal project and VSCode editor, it turns out that the pseudoconsole provided by Windows OS is severely outdated which manifests itself in problems such as lack of clearing behaviour, etc. Interestingly however, neither MS Terminal nor VSCode exhibit this limitation so the question was why. Enter custom `conpty.dll` and `OpenConsole.exe` runtime. These are updated, developed in MS Terminal tree subprojects that aim to replace native Windows API as well as augment the `conhost.exe` process that runs by default in Windows. They also fix all the woes we had with the terminal on Windows (there is a chance that ctrl-c behaviour is also fixed with these, but still need to double check that this is indeed the case). This PR ensures that Zed also benefits from the update pseudoconsole API. # Proposed approach It is possible to fork MS Terminal and instrument the necessary subprojects for Rust-awareness (using `cc-rs` or otherwise to compile the C++ code and then embed it in Rust-produced binaries for easier inclusion in projects) but it comes at a cost of added complexity, maintenance burden, etc. An alternative approach was proposed by @reflectronic to download the binary from the official Nuget repo and bundle it for release/local use. This PR aims to do just that. There are two bits to this PR: 1. ~~when building Zed locally, and more specifically, when the `zed` crate is being built, we will strive to download and unpack the binaries into `OUT_DIR` provided by `cargo`. We will then set `ZED_CONPTY_INSTALL_PATH=${OUT_DIR}/conpty` and use it at runtime in Zed binary to tweak the loader's search path with that additional path. This effectively ensures that Zed built from source on Windows has full terminal support.~~ EDIT: after several discussions offline, we've decided that keeping it minimal will serve us best, meaning: when developing locally it is up to the developer of Zed to install `conpty.dll` and put it in the loader's search path. 2. when bundling Windows release, we will download and unpack the nuget package into Zed's bundle which will ensure it is installed in the same directory as Zed by the installer. **Note** I realise that 1. may actually not be needed - instead we could leave that bit for the user who wants to run Zed from source to ensure that they have `conpty.dll` in the loader's search path. I'd love to hear opinions on this! Release Notes: - N/A --------- Co-authored-by: Cole Miller <cole@zed.dev>
Zed
Welcome to Zed, a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
Installation
On macOS and Linux you can download Zed directly or install Zed via your local package manager.
Other platforms are not yet available:
- Windows (tracking issue)
- Web (tracking issue)
Developing Zed
- Building Zed for macOS
- Building Zed for Linux
- Building Zed for Windows
- Running Collaboration Locally
Contributing
See CONTRIBUTING.md for ways you can contribute to Zed.
Also... we're hiring! Check out our jobs page for open roles.
Licensing
License information for third party dependencies must be correctly provided for CI to pass.
We use cargo-about to automatically comply with open source licenses. If CI is failing, check the following:
- Is it showing a
no license specifiederror for a crate you've created? If so, addpublish = falseunder[package]in your crate's Cargo.toml. - Is the error
failed to satisfy license requirementsfor a dependency? If so, first determine what license the project has and whether this system is sufficient to comply with this license's requirements. If you're unsure, ask a lawyer. Once you've verified that this system is acceptable add the license's SPDX identifier to theacceptedarray inscript/licenses/zed-licenses.toml. - Is
cargo-aboutunable to find the license for a dependency? If so, add a clarification field at the end ofscript/licenses/zed-licenses.toml, as specified in the cargo-about book.
Description
GPUI – Community Edition maintained by Oak Team
https://gpui-ce.github.io/
257 MiB
Languages
Rust
95.5%
WGSL
1.2%
Metal
1.1%
HLSL
1.1%
Python
0.7%
Other
0.3%