Skip to content

Commit

Permalink
fix: prevent empty window title
Browse files Browse the repository at this point in the history
If Neovim attempts to send an empty window title, it is now set to
Neovide instead, rather than the empty string.

This improves two user scenarios:

- Users who utilize assistive technologies will now always observe a
  window title by default.
- Users of window managers that rely on window titles will have improved
  integration.

The precipitating use case was using Komorebi, a tiling window manager
for Windows. Komorebi uses an empty window title as a strong signal that
the software is a hidden window, as this is a common convention on the
platform.

Updates #1553
  • Loading branch information
raggi committed Nov 13, 2023
1 parent b79b7cc commit e8a85ea
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/editor/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,11 @@ impl Editor {
pub fn handle_editor_command(&mut self, command: EditorCommand) {
match command {
EditorCommand::NeovimRedrawEvent(event) => match event {
RedrawEvent::SetTitle { title } => {
RedrawEvent::SetTitle { mut title } => {
tracy_zone!("EditorSetTitle");
if title.is_empty() {
title = "Neovide".to_string()
}
EVENT_AGGREGATOR.send(WindowCommand::TitleChanged(title));
}
RedrawEvent::ModeInfoSet { cursor_modes } => {
Expand Down

0 comments on commit e8a85ea

Please sign in to comment.