Repository: alacritty/alacritty (language: rust)

Issue:
Alacritty 0.13.2 (and 1cc08eb) leaks file descriptors
First of all, thank you for maintaining and developing Alacritty! I've encountered an issue where Alacritty leaks a number of file descriptors on my system (using `% alacritty`):
```
% ls -la /proc/self/fd
lrwx------ 64 user 16 Oct 21:43  0 -> /dev/pts/4
lrwx------ 64 user 16 Oct 21:43  1 -> /dev/pts/4
lrwx------ 64 user 16 Oct 21:43  2 -> /dev/pts/4
lr-x------ 64 user 16 Oct 21:43  15 -> pipe:[150277]
l-wx------ 64 user 16 Oct 21:43  16 -> pipe:[150277]
lr-x------ 64 user 16 Oct 21:43  19 -> pipe:[150280]
l-wx------ 64 user 16 Oct 21:43  20 -> pipe:[150280]
```

Every new alacritty subprocess inherits more file descriptors (using `% alacritty -e alacritty`):
```
% ls -la /proc/self/fd
lrwx------ 64 user 16 Oct 21:43  0 -> /dev/pts/5
lrwx------ 64 user 16 Oct 21:43  1 -> /dev/pts/5
lrwx------ 64 user 16 Oct 21:43  2 -> /dev/pts/5
lr-x------ 64 user 16 Oct 21:43  15 -> pipe:[152262]
l-wx------ 64 user 16 Oct 21:43  16 -> pipe:[152262]
lr-x------ 64 user 16 Oct 21:43  17 -> pipe:[167016]
l-wx------ 64 user 16 Oct 21:43  18 -> pipe:[167016]
lr-x------ 64 user 16 Oct 21:43  19 -> pipe:[152265]
l-wx------ 64 user 16 Oct 21:43  20 -> pipe:[152265]
lr-x------ 64 user 16 Oct 21:43  23 -> pipe:[167019]
l-wx------ 64 user 16 Oct 21:43  24 -> pipe:[167019]
```
This also applies to the `SpawnNewInstance` action.

The expected behavior is that subprocesses do not inherit any additional file descriptors (tested using a different terminal emulator `% st`):
```
% ls -la /proc/self/fd
lrwx------ 64 user 16 Oct 21:44  0 -> /dev/pts/4
lrwx------ 64 user 16 Oct 21:44  1 -> /dev/pts/4
lrwx------ 64 user 16 Oct 21:44  2 -> /dev/pts/4
```

I'm sure this is reproducible not just on my system, but I'd be happy to provide more information if needed.

### System

OS: Linux
Version: `alacritty 0.13.2` (also occurs with commit `1cc08eb`)
Linux/BSD: X11, picom and bspwm

### Logs

Crashes: N/A
Font/Terminal size:
```
[0.010115162s] [INFO ] [alacritty] Using GLX 1.4
[0.010219501s] [DEBUG] [alacritty] Picked GL Config:
                                     buffer_type: Some(Rgb { r_size: 8, g_size: 8, b_size: 8 })
                                     alpha_size: 8
                                     num_samples: 0
                                     hardware_accelerated: true
                                     supports_transparency: Some(true)
                                     config_api: Api(OPENGL | GLES1 | GLES2)
                                     srgb_capable: true
[0.010675829s] [INFO ] [alacritty] Window scale factor: 1
[0.016141222s] [DEBUG] [alacritty] Loading "ComicCode Nerd Font" font
[0.029547707s] [DEBUG] [crossfont] Loaded Face Face { ft_face: Font Face: Regular, load_flags: TARGET_LIGHT, render_mode: "Normal", lcd_filter: 1 }
[0.038463624s] [DEBUG] [crossfont] Loaded Face Face { ft_face: Font Face: Bold, load_flags: TARGET_LIGHT, render_mode: "Normal", lcd_filter: 1 }
[0.047688520s] [DEBUG] [crossfont] Loaded Face Face { ft_face: Font Face: Italic, load_flags: TARGET_LIGHT, render_mode: "Normal", lcd_filter: 1 }
[0.056412088s] [DEBUG] [crossfont] Loaded Face Face { ft_face: Font Face: Bold Italic, load_flags: TARGET_LIGHT, render_mode: "Normal", lcd_filter: 1 }
[0.122824677s] [INFO ] [alacritty] Running on NVIDIA GeForce GTX 1060 6GB/PCIe/SSE2
[0.122835576s] [INFO ] [alacritty] OpenGL version 3.3.0 NVIDIA 550.54.14, shader_version 3.30 NVIDIA via Cg compiler
[0.122842166s] [INFO ] [alacritty] Using OpenGL 3.3 renderer
[0.125721552s] [DEBUG] [alacritty] Enabled debug logging for OpenGL
[0.125730982s] [DEBUG] [alacritty] Filling glyph cache with common glyphs
[0.127609543s] [INFO ] [alacritty] Cell size: 7 x 15
[0.127616953s] [INFO ] [alacritty] Padding: 1 x 0
[0.127621533s] [INFO ] [alacritty] Width: 800, Height: 600
[0.132175231s] [INFO ] [alacritty] PTY dimensions: 40 x 114
[0.133500665s] [INFO ] [alacritty] Initialisation complete
[0.133786993s] [DEBUG] [alacritty] [gl_render] Buffer detailed info: Buffer object 2 (bound to GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB (0), GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB (1), GL_VERTEX_ATTRIB_ARRAY_BU
FFER_BINDING_ARB (2), GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB (3), GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB (4), and GL_ARRAY_BUFFER_ARB, usage hint is GL_STREAM_DRAW) will use VIDEO memory as the source for buf
fer object operations.
[0.141322377s] [DEBUG] [alacritty_terminal] New num_cols is 122 and num_lines is 94
[0.147082919s] [INFO ] [alacritty] Padding: 0 x 1
[0.147093859s] [INFO ] [alacritty] Width: 855, Height: 1412
[0.162072057s] [DEBUG] [alacritty] [gl_render] Buffer detailed info: Buffer object 3 (bound to GL_VERTEX_A
TTRIB_ARRAY_BUFFER_BINDING_ARB (0), GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB (1), and GL_ARRAY_BUFFER_ARB
, usage hint is GL_STATIC_DRAW) will use VIDEO memory as the source for buffer object operations.
[20.047925532s] [DEBUG] [alacritty_terminal] New num_cols is 122 and num_lines is 46
[20.050221571s] [INFO ] [alacritty] Padding: 0 x 7
[20.050232651s] [INFO ] [alacritty] Width: 855, Height: 704
[27.295697514s] [DEBUG] [alacritty_terminal] New num_cols is 122 and num_lines is 94
[27.298038453s] [INFO ] [alacritty] Padding: 0 x 1
[27.298053603s] [INFO ] [alacritty] Width: 855, Height: 1412
[28.009577023s] [INFO ] [alacritty] Goodbye
```
Keyboard and bindings: N/A



Discussion / hints:
>  Version: alacritty 0.13.2 (also occurs with commit 1cc08eb)

Have you tested previous versions?

I don't see how this would ever create issues, considering these file descriptors aren't leaked based on your observation (they just aren't cleared from child processes). But if it's something easy to fix it's probably not a bad idea to clean up.
Aren't those from mesa?
Not sure how it'll help, but on my system all of them got fixed with https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31700

Though, I'm on Wayland and maybe something specific to x11 is getting leaked on your setup.
Ah, you have X11 specific stuff and maybe your mesa doesn't have 300 fds leaked yet.


That's your issue, which should be simple to fix


https://github.com/quininer/x11-clipboard/commit/a716f799e324a7a00b01d22e8da1acffbd468654

Fix patch:
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 9f93e4e0e0b..2b3d2b46b97 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -8,7 +8,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
 Notable changes to the `alacritty_terminal` crate are documented in its
 [CHANGELOG](./alacritty_terminal/CHANGELOG.md).
 
-## 0.14.0-rc2
+## 0.14.0
 
 ### Packaging
 
@@ -18,7 +18,6 @@ Notable changes to the `alacritty_terminal` crate are documented in its
 
 - Support relative path imports from config files
 - `alacritty migrate` support for TOML configuration changes
-- Support for Unicode 16 characters
 - Headless mode using `alacritty --daemon`
 
 ### Changed
diff --git a/Cargo.lock b/Cargo.lock
index a61ad389504..961ef3ab82d 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -32,7 +32,7 @@ dependencies = [
 
 [[package]]
 name = "alacritty"
-version = "0.14.0-rc2"
+version = "0.14.0"
 dependencies = [
  "ahash",
  "alacritty_config",
@@ -61,7 +61,7 @@ dependencies = [
  "tempfile",
  "toml",
  "toml_edit 0.22.21",
- "unicode-width-16",
+ "unicode-width",
  "windows-sys 0.52.0",
  "winit",
  "xdg",
@@ -69,7 +69,7 @@ dependencies = [
 
 [[package]]
 name = "alacritty_config"
-version = "0.2.2-rc2"
+version = "0.2.2"
 dependencies = [
  "alacritty_config_derive",
  "log",
@@ -79,7 +79,7 @@ dependencies = [
 
 [[package]]
 name = "alacritty_config_derive"
-version = "0.2.4-rc2"
+version = "0.2.4"
 dependencies = [
  "alacritty_config",
  "log",
@@ -92,7 +92,7 @@ dependencies = [
 
 [[package]]
 name = "alacritty_terminal"
-version = "0.24.1-rc2"
+version = "0.24.1"
 dependencies = [
  "base64",
  "bitflags 2.6.0",
@@ -108,7 +108,7 @@ dependencies = [
  "serde",
  "serde_json",
  "signal-hook",
- "unicode-width-16",
+ "unicode-width",
  "vte",
  "windows-sys 0.52.0",
 ]
@@ -2011,10 +2011,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "d4c87d22b6e3f4a18d4d40ef354e97c90fcb14dd91d7dc0aa9d8a1172ebf7202"
 
 [[package]]
-name = "unicode-width-16"
-version = "0.1.0"
+name = "unicode-width"
+version = "0.1.13"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9eba15036aa0f5bf8ed6cd12a624ddb61fd50b0779b1c05d89b663bcaed7b5c2"
+checksum = "0336d538f7abc86d282a4189614dfaa90810dfc2c6f6427eaf88e16311dd225d"
 
 [[package]]
 name = "unsafe-libyaml"
@@ -2626,9 +2626,9 @@ dependencies = [
 
 [[package]]
 name = "x11-clipboard"
-version = "0.9.2"
+version = "0.9.3"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b98785a09322d7446e28a13203d2cae1059a0dd3dfb32cb06d0a225f023d8286"
+checksum = "662d74b3d77e396b8e5beb00b9cad6a9eccf40b2ef68cc858784b14c41d535a3"
 dependencies = [
  "libc",
  "x11rb",
diff --git a/alacritty/Cargo.toml b/alacritty/Cargo.toml
index b8f9c3936f9..d80a5986467 100644
--- a/alacritty/Cargo.toml
+++ b/alacritty/Cargo.toml
@@ -1,6 +1,6 @@
 [package]
 name = "alacritty"
-version = "0.14.0-rc2"
+version = "0.14.0"
 authors = ["Christian Duerr <contact@christianduerr.com>", "Joe Wilm <joe@jwilm.com>"]
 license = "Apache-2.0"
 description = "A fast, cross-platform, OpenGL terminal emulator"
@@ -12,15 +12,15 @@ rust-version = "1.74.0"
 
 [dependencies.alacritty_terminal]
 path = "../alacritty_terminal"
-version = "0.24.1-rc2"
+version = "0.24.1"
 
 [dependencies.alacritty_config_derive]
 path = "../alacritty_config_derive"
-version = "0.2.4-rc2"
+version = "0.2.4"
 
 [dependencies.alacritty_config]
 path = "../alacritty_config"
-version = "0.2.2-rc2"
+version = "0.2.2"
 
 [dependencies]
 ahash = { version = "0.8.6", features = ["no-rng"] }
@@ -40,7 +40,7 @@ serde_yaml = "0.9.25"
 tempfile = "3.12.0"
 toml = "0.8.2"
 toml_edit = "0.22.21"
-unicode-width = { package = "unicode-width-16", version = "0.1.0" }
+unicode-width = "0.1"
 winit = { version = "0.30.4", default-features = false, features = ["rwh_06", "serde"] }
 
 [build-dependencies]
diff --git a/alacritty/windows/wix/alacritty.wxs b/alacritty/windows/wix/alacritty.wxs
index d0267bb65bf..cd00bda0bcd 100644
--- a/alacritty/windows/wix/alacritty.wxs
+++ b/alacritty/windows/wix/alacritty.wxs
@@ -1,5 +1,5 @@
 <Wix xmlns="http://wixtoolset.org/schemas/v4/wxs" xmlns:ui="http://wixtoolset.org/schemas/v4/wxs/ui">
-   <Package Name="Alacritty" UpgradeCode="87c21c74-dbd5-4584-89d5-46d9cd0c40a7" Language="1033" Codepage="1252" Version="0.14.0-rc2" Manufacturer="Alacritty" InstallerVersion="200">
+   <Package Name="Alacritty" UpgradeCode="87c21c74-dbd5-4584-89d5-46d9cd0c40a7" Language="1033" Codepage="1252" Version="0.14.0" Manufacturer="Alacritty" InstallerVersion="200">
       <MajorUpgrade AllowSameVersionUpgrades="yes" DowngradeErrorMessage="A newer version of [ProductName] is already installed." />
       <Icon Id="AlacrittyIco" SourceFile=".\alacritty\windows\alacritty.ico" />
       <WixVariable Id="WixUILicenseRtf" Value=".\alacritty\windows\wix\license.rtf" />
diff --git a/alacritty_config/Cargo.toml b/alacritty_config/Cargo.toml
index a275aa85c69..862c6eb875f 100644
--- a/alacritty_config/Cargo.toml
+++ b/alacritty_config/Cargo.toml
@@ -1,6 +1,6 @@
 [package]
 name = "alacritty_config"
-version = "0.2.2-rc2"
+version = "0.2.2"
 authors = ["Christian Duerr <contact@christianduerr.com>"]
 license = "MIT OR Apache-2.0"
 description = "Alacritty configuration abstractions"
@@ -15,5 +15,5 @@ serde = "1.0.163"
 toml = "0.8.2"
 
 [dev-dependencies]
-alacritty_config_derive = { version = "0.2.4-rc2", path = "../alacritty_config_derive" }
+alacritty_config_derive = { version = "0.2.4", path = "../alacritty_config_derive" }
 serde = { version = "1.0.163", features = ["derive"] }
diff --git a/alacritty_config_derive/Cargo.toml b/alacritty_config_derive/Cargo.toml
index bca0e402871..bf439ce75d1 100644
--- a/alacritty_config_derive/Cargo.toml
+++ b/alacritty_config_derive/Cargo.toml
@@ -1,6 +1,6 @@
 [package]
 name = "alacritty_config_derive"
-version = "0.2.4-rc2"
+version = "0.2.4"
 authors = ["Christian Duerr <contact@christianduerr.com>"]
 license = "MIT OR Apache-2.0"
 description = "Failure resistant deserialization derive"
@@ -19,7 +19,7 @@ syn = { version = "2.0.16", features = ["derive", "parsing", "proc-macro", "prin
 
 [dev-dependencies.alacritty_config]
 path = "../alacritty_config"
-version = "0.2.2-rc2"
+version = "0.2.2"
 
 [dev-dependencies]
 log = "0.4.11"
diff --git a/alacritty_terminal/CHANGELOG.md b/alacritty_terminal/CHANGELOG.md
index 25f331b7a6f..e612e7498ec 100644
--- a/alacritty_terminal/CHANGELOG.md
+++ b/alacritty_terminal/CHANGELOG.md
@@ -8,7 +8,7 @@ sections should follow the order `Added`, `Changed`, `Deprecated`, `Fixed` and
 
 The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
 
-## 0.24.1-rc2
+## 0.24.1
 
 ### Changed
 
diff --git a/alacritty_terminal/Cargo.toml b/alacritty_terminal/Cargo.toml
index 057fe7e4942..aca99825353 100644
--- a/alacritty_terminal/Cargo.toml
+++ b/alacritty_terminal/Cargo.toml
@@ -1,6 +1,6 @@
 [package]
 name = "alacritty_terminal"
-version = "0.24.1-rc2"
+version = "0.24.1"
 authors = ["Christian Duerr <contact@christianduerr.com>", "Joe Wilm <joe@jwilm.com>"]
 license = "Apache-2.0"
 description = "Library for writing terminal emulators"
@@ -23,8 +23,8 @@ log = "0.4"
 parking_lot = "0.12.0"
 polling = "3.0.0"
 regex-automata = "0.4.3"
-unicode-width = { package = "unicode-width-16", version = "0.1.0" }
-vte = { version = "0.13.0", default-features = false, features = ["ansi", "serde"] }
+unicode-width = "0.1"
+vte = { version = "0.13.0", default-features = false, features = ["ansi"] }
 serde = { version = "1", features = ["derive", "rc"], optional = true }
 
 [target.'cfg(unix)'.dependencies]
diff --git a/extra/osx/Alacritty.app/Contents/Info.plist b/extra/osx/Alacritty.app/Contents/Info.plist
index 1143d78c007..08bf4270b19 100644
--- a/extra/osx/Alacritty.app/Contents/Info.plist
+++ b/extra/osx/Alacritty.app/Contents/Info.plist
@@ -15,7 +15,7 @@
   <key>CFBundlePackageType</key>
   <string>APPL</string>
   <key>CFBundleShortVersionString</key>
-  <string>0.14.0-rc2</string>
+  <string>0.14.0</string>
   <key>CFBundleSupportedPlatforms</key>
   <array>
     <string>MacOSX</string>


Test patch: