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

Already on GitHub? Sign in to your account

emacs leaves terminal in underline mode #59

Closed
risacher opened this Issue Dec 11, 2012 · 5 comments

Comments

Projects
None yet
2 participants

Steps to duplicate:

  1. Start emacs (I'm using version 23.3.1 on Ubuntu)
  2. Let emacs finish loading all the crap it loads.
  3. Hit Ctrl-x Ctrl-c to exit emacs.
  4. Observe that everything in the terminal is underlined.

Optional:
5. run "reset" to put your terminal back to normal.

Not a big deal, but an issue nonetheless.

I turned on debugging to see the control codes issued when emacs exits, and decoded them all by hand.
Everything looks benign except this one:

^[[>4m

Now "^[[4m" would mean "Character Attributes: Underlined" according to http://www.xfree86.org/current/ctlseqs.html

But that reference doesn't seem to clue me in as to the meaning of the '>' character.

Ah. This ref: http://invisible-island.net/xterm/ctlseqs/ctlseqs.html shows that ^[[>4m should mean something different.

Interestingly the correct code is in term.js but is commented out. Here's my change, which I will make a pull request for later.

          // CSI Pm m  Character Attributes (SGR).                                                                          
          case 'm':                                                                                                         
            if (!this.prefix) {                                                                                             
                this.charAttributes(this.params);                                                                           
            }                                                                                                               
            break;                                                                                                          

          // CSI Ps n  Device Status Report (DSR).                                                                          
          case 'n':                                                                                                         
            if (!this.prefix) {                                                                                             
                this.deviceStatus(this.params);                                                                             
            }                                                                                                               
            break;                      

@risacher risacher referenced this issue Apr 26, 2013

Closed

Emacs fix #85

risacher added a commit to risacher/ttyx that referenced this issue Apr 26, 2013

fixes issue #59 in chjj's tree
^[[>##m and ^[[>##n are legal escape sequences, but were being parsed as if they were ^[[##m or ^[[##n.
Added a test for prefix character ('>' is the only legal one)

If the prefix char is present, ignores the control sequence, since that code isn't implemented.

@risacher running into the same problem? Is your fixed finished, if so could you open a new PR please?

PR #87 fixes this problem, and is finished as far as I know.

risacher added a commit to risacher/term.js that referenced this issue Dec 5, 2013

Fix issue chjj/tty.js#59
^[[>##m and ^[[>##n are legal escape sequences, but were being parsed as if they were ^[[##m or ^[[##n. Added a test for prefix character ('>'
is the only legal one)  See http://invisible-island.net/xterm/ctlseqs/ctlseqs.html, codes for CSI > P s ; P s m

If the prefix char is present, ignores the control sequence, since that code isn't implemented.

chjj added a commit to chjj/term.js that referenced this issue Dec 6, 2013

risacher commented Dec 6, 2013

Thanks

@risacher risacher closed this Dec 6, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment