Skip to content

Commit

Permalink
#1489 escape app name in queries
Browse files Browse the repository at this point in the history
  • Loading branch information
koekeishiya committed Oct 20, 2022
1 parent 8153385 commit 4d8e900
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm

## [Unreleased]
### Changed
- Properly escape application name when returned in window queries [#1489](https://github.com/koekeishiya/yabai/issues/1489)
- Remove window tags used for debugging purposes from result of window query because it could cause a crash under certain conditions when a window closes [#1475](https://github.com/koekeishiya/yabai/issues/1475)

## [5.0.1] - 2022-09-26
Expand Down
4 changes: 3 additions & 1 deletion src/window.c
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,8 @@ void window_serialize(FILE *rsp, struct window *window)
{
char *role = window_role_ts(window);
char *subrole = window_subrole_ts(window);
char *app = window->application->name;
char *escaped_app = ts_string_escape(app);
char *title = window_title_ts(window);
char *escaped_title = ts_string_escape(title);
uint64_t sid = window_space(window);
Expand Down Expand Up @@ -170,7 +172,7 @@ void window_serialize(FILE *rsp, struct window *window)
"}",
window->id,
window->application->pid,
window->application->name,
escaped_app ? escaped_app : app,
escaped_title ? escaped_title : title,
window->frame.origin.x, window->frame.origin.y, window->frame.size.width, window->frame.size.height,
role,
Expand Down

0 comments on commit 4d8e900

Please sign in to comment.