From 9ef8fa2ae7bc9c556570bb01d02ce119999f07f5 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 22 Apr 2025 09:44:28 +0530 Subject: [PATCH] Fix a regression in 0.36.0 that caused using = with single letter options to no longer work correctly Fixes #8556 --- docs/changelog.rst | 3 +++ kitty/launcher/main.c | 5 ++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/docs/changelog.rst b/docs/changelog.rst index 7ad59f544..bf8d48f60 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -118,6 +118,9 @@ Detailed list of changes - panel kitten: Allow specifying panel size in pixels in addition to cells +- Fix a regression in 0.36.0 that caused using = with single letter options to + no longer work correctly (:iss:`8556`) + 0.41.1 [2025-04-03] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/kitty/launcher/main.c b/kitty/launcher/main.c index 582a72bf6..15cbe32cd 100644 --- a/kitty/launcher/main.c +++ b/kitty/launcher/main.c @@ -407,9 +407,12 @@ handle_option_value: } } else { char buf[2] = {0}; + current_option_expecting_argument[0] = 0; for (int i = 1; arg[i] != 0; i++) { switch(arg[i]) { - case '=': fprintf(stderr, "= is not allowed in short options, only long options. -d=xyz is illegal, --directory=xyz is legal. Use -d xyz instead.\n"); exit(1); break; + case '=': + arg = arg + i + 1; + goto handle_option_value; case 'v': opts.version_requested = true; break; case '1': opts.single_instance = true; break; default: