doomemacs / doomemacs/core

`enable-theme` in tty client messes up gui clients

Open
#7,730 12 comments 0 reactions 1 assignee Claimed by @hlissner View on GitHub
core is:bug re:emacs:daemon re:fonts
Dominant language
Emacs Lisp
Stars
22.7k
Forks
3.1k
Avg merge
10h 46m
Merged PRs (30d)
4

Description

### I confirm that...

- [X] I have searched the [issue tracker](https://github.com/doomemacs/doomemacs/issues), [documentation](https://docs.doomemacs.org), [FAQ](https://docs.doomemacs.org/-/faq), [Discourse](https://discourse.doomemacs.org), and [Google](https://google.com), in case this issue has already been reported/resolved.
- [X] I have read "[How to Debug Issues](https://doomemacs.org/d/how2debug)", and will use it to provide as much information about this issue as possible.
- [X] The issue can be reproduced on the **latest** available commit of Doom.
- [X] The issue can be reproduced on a stable release of Emacs, such as 27, 28, or 29. *(Unstable versions end in .50, .60, or .9x)*

### Expected behavior

When I have both graphical and terminal emacsclient processes open, and I run `enable-theme` in a terminal emacsclient, the theme should be loaded properly in all open graphical emacsclients. (I have verified that this is the case with a daemon launched as `emacs -Q`.)

### Current behavior

When I run `enable-theme` in a terminal emacsclient, this display of the graphical emacsclient suddenly 'shrinks'. This is much easier to show with screenshots -

Before running `enable-theme` (left - a graphical emacsclient frame; right - `emacsclient -nw`):
![20240313_17h32m49s_grim](https://github.com/doomemacs/doomemacs/assets/32428205/835e6d95-7543-49e7-8cfa-462bf85b39d8)

After running `enable-theme`:
![20240313_17h32m21s_grim](https://github.com/doomemacs/doomemacs/assets/32428205/ab44ffd7-6675-4596-a371-4c57604419c3)

### Steps to reproduce

1. Start emacs daemon with `emacs --daemon=xyz`
2. Start graphical emacsclient with `emacsclient -s xyz --create-frame`
3. Start terminal emacsclient with `emacsclient -s xyz -nw`
4. Run `M-: (enable-theme doom-theme)` in the terminal emacsclient
5. Observe the results depicted in the screenshots above

Note that this also happens with `load-theme`.

The issue happens for non-doom themes as well - replace Step 4 with `M-x load-theme tango-dark` and you'll see the same result.

## Background

I encountered this bug because I was running `(enable-theme doom-theme)` on `server-after-make-frame-hook`, as a workaround for [this solaire-mode issue](https://github.com/hlissner/emacs-solaire-mode/issues/46).

### System Information

https://0x0.st/HhCb.txt

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.