#13157·ohmyzsh

(emacs) 'emacsclient: file name or argument required' with 'emacs' command

Author: Schievel1Created Jun 7, 2025Updated Sep 6, 2026
LabelsBug

Describe the bug

I do not know when this started, but when I run 'emacs' or 'e' it says

emacsclient: file name or argument required
Try 'emacsclient --help' for more information

When I comment line 16 in omz' emacsclient.sh ( frames="$(emacsclient -a '' -n -e "$cmd" 2>/dev/null |sed 's/.*\x07//g' )") it works.

Strangely enought, when I run the line emacsclient -a -n -e "(delete 't (mapcar 'framep (frame-list)))" 2>/dev/null |sed 's/.*\x07//g' (this is what the script does) in /bin/sh like the shebang of the script, the message does not occur. It just returns (x). I guess this is what it is supposed to do.

Steps to reproduce

  1. enable emacs plugin
  2. source zshrc
  3. run e

Expected behavior

emacsclient opens a buffer in the existing emacs frame or opens a new frame if none exists.

Screenshots and recordings

No response

OS / Linux distribution

Gentoo

Zsh version

5.9

Oh My Zsh version

master (095ac3c)

Terminal emulator

alacritty

If using WSL on Windows, which version of WSL

None

Additional context

Emacs version: GNU Emacs 30.1 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.49, cairo version 1.18.4) of 2025-05-11