emacsclient启动fcitx的问题

原始问题

尝试用emacs server方式启动emacs后,发现emacsclient中不用启动fcitx。

解决方法

emacs.service中的ExecStart=/usr/bin/emacs --fg-daemon改为ExecStart=/usr/bin/emacs --daemon,再次启动emacs server后就能在emacsclient中启动fcitx了。

[Unit]
Description=Emacs text editor
Documentation=info:emacs man:emacs(1) https://gnu.org/software/emacs/

[Service]
Type=notify
#ExecStart=/usr/bin/emacs --fg-daemon
ExecStart=/usr/bin/emacs --daemon
ExecStop=/usr/bin/emacsclient --eval "(kill-emacs)"
Environment=XMODIFIERS=@im=fcitx
Environment=GTK_IM_MODULE=fcitx

# Emacs will exit with status 15 after having received SIGTERM, which
# is the default "KillSignal" value systemd uses to stop services.
SuccessExitStatus=15

# The location of the SSH auth socket varies by distribution, and some
# set it from PAM, so don't override by default.
# Environment=SSH_AUTH_SOCK=%t/keyring/ssh
Restart=on-failure

[Install]
WantedBy=default.target

新问题

我查了一下-fg-daemon选项,指的是don't disconnect from the terminal,为啥这种方式启动emacs server就不能启动fcitx了呢?