Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Emacs xterm specific initialization does not complete properly #3700

Closed
EvgeneOskin opened this issue Mar 21, 2022 · 6 comments · Fixed by #3704
Closed

Emacs xterm specific initialization does not complete properly #3700

EvgeneOskin opened this issue Mar 21, 2022 · 6 comments · Fixed by #3704
Milestone

Comments

@EvgeneOskin
Copy link

EvgeneOskin commented Mar 21, 2022

The emacs cannot define xterm configuration of the background color.
I've debugged the issue down to the point when emacs queries the xterm background color.

Unfortunately, I cannot provide more exact reasons and errors due to a lack of emacs debugging experience.

Details

  • Browser and browser version: Electron 17
  • OS version: macOS 12.3
  • xterm.js version: 4.17.0 and 4.18. Possibly, 4.16.0 affected, too.
  • emacs: 26 or 27. Most probably, older versions are affected, too

Steps to reproduce

  1. Run the emacs command
  2. Observe the current window
  3. *scratch* is opened. Expected that the *GNU Emacs* window is opened.
@EvgeneOskin
Copy link
Author

For the record, it looks like xtermjs handles printf "\x1b]11;?\x07" properly.

@jerch
Copy link
Member

jerch commented Mar 23, 2022

This is prolly caused by the returned sequence from here:

this.coreService.triggerDataEvent(`${C0.ESC}]${ident};${toRgbString(channels)}${C0.BEL}`);

which appends BEL as OSC finalizer, while the emacs function expects ST as finalizer in https://github.com/emacs-mirror/emacs/blob/d7f4cc0974645cc6a295740afe85c6e21d956119/lisp/term/xterm.el#L682.

Background: BEL as OSC finalizer was a defacto standard for several years introduced by xterm somewhere in the 90s. ST is the official and only allowed finalizer from ECMA-48. Now there is some confusion, whether to use BEL or ST. Newer xterm versions switched to ST I think, guess xterm.js should use ST as well (with a chance to break older apps though, that only scan for BEL).

@Tyriar
Copy link
Member

Tyriar commented Mar 23, 2022

I've got reports like this about emacs breaking and opening a scratch file for some time now and was totally puzzled by them microsoft/vscode#142754. If we can fix this by switching to ST here that's great news 🎉

@Tyriar Tyriar added this to the 4.19.0 milestone Mar 23, 2022
@Tyriar
Copy link
Member

Tyriar commented Mar 23, 2022

fyi @meganrogge

@meganrogge
Copy link
Member

Nice find! @jerch I was stumped as well.

@EvgeneOskin
Copy link
Author

Thanks, @meganrogge, and @jerch!
I've checked your change. It solves the issue. 🎉

I cannot wait for the 4.19.0 release.🥇 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants