From 0431f1c33d6dfc1da33e1724470840b069d28dc3 Mon Sep 17 00:00:00 2001 From: Mingyang Wu Date: Mon, 28 Sep 2026 15:41:06 +0800 Subject: [PATCH] fix(emacs): create a frame for empty launcher invocations (#14091) Co-authored-by: Carlo Sala --- plugins/emacs/emacsclient.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/plugins/emacs/emacsclient.sh b/plugins/emacs/emacsclient.sh index 208eec713..57626c2e2 100755 --- a/plugins/emacs/emacsclient.sh +++ b/plugins/emacs/emacsclient.sh @@ -32,8 +32,9 @@ emacsfun() { # Check if there are suitable frames frames="$(emacsclient -a '' -n -e "$cmd" 2>/dev/null |sed 's/.*\x07//g' )" - # Only create another X frame if there isn't one present - if [ -z "$frames" -o "$frames" = nil ]; then + # A bare emacs/e passes only --no-wait, so it still needs --create-frame. + if [ -z "$frames" ] || [ "$frames" = nil ] || [ "$#" -eq 0 ] \ + || { [ "$#" -eq 1 ] && [ "$1" = --no-wait ]; }; then emacsclient --alternate-editor="" --create-frame "$@" return $? fi