randy3k / Terminus

Bring a real terminal to Sublime Text
https://packagecontrol.io/packages/Terminus
MIT License
1.37k stars 83 forks source link

Vim stop working, getting TypeError (macOS 13.2) #385

Closed dpslwk closed 1 year ago

dpslwk commented 1 year ago

Something has changed somewhere in my setup in the last few days that had broken vim inside a terminal I suspect its something in macOS 13.2 which was just installed, unfortunately I done have a machine still on 13.1 to check

I open a new terminus tab, try vi test and it just hangs Included error from the sublime console below and attached screen recording Its only when trying my local (macOS) vi, I can ssh into a linux machine and vi works fine Happy to help debug as needed and hoping it can be fixed within terminus since this really puts a crimp in my daily work flows

Traceback (most recent call last):
  File "./python3.3/threading.py", line 901, in _bootstrap_inner
  File "./python3.3/threading.py", line 858, in run
  File "/Users/matt/Library/Application Support/Sublime Text/Installed Packages/Terminus.sublime-package/terminus/terminal.py", line 164, in renderer
    feed_data()
  File "/Users/matt/Library/Application Support/Sublime Text/Installed Packages/Terminus.sublime-package/terminus/terminal.py", line 159, in feed_data
    self.stream.feed(data[0])
  File "/Users/matt/Library/Application Support/Sublime Text/Installed Packages/Terminus.sublime-package/terminus/ptty.py", line 796, in feed
    yield_what = send(data[offset:offset + 1])
  File "/Users/matt/Library/Application Support/Sublime Text/Installed Packages/Terminus.sublime-package/terminus/ptty.py", line 737, in _parser_fsm
    csi_dispatch[char](*params, private=True)
TypeError: select_graphic_rendition() got an unexpected keyword argument 'private'

https://user-images.githubusercontent.com/234460/215024189-7fdb546e-c5eb-4809-8437-743b853ce50c.mov

Apple silicon MacOS Venture 13.2 Sublime Text 4143

$ vi --version
VIM - Vi IMproved 9.0 (2022 Jun 28, compiled Dec 16 2022 23:29:16)
macOS version - arm64
Included patches: 1-981
Compiled by root@apple.com
dpslwk commented 1 year ago

Same thing is happening now on my older intel Mac, was fine on macOS 12.5 but update to 12.6.3 and getting same error

dpslwk commented 1 year ago

https://support.apple.com/en-us/HT213605

Vim Available for: macOS Ventura Impact: Multiple issues in Vim Description: A use after free issue was addressed with improved memory management. CVE-2022-3705

tracked this down to some change in vim as above related to modifyOtherKeys and xterm XTQMODKEYS, some error then processing ESC[?4m and me having set "unix_term": "xterm-256color" in my settings,

if I remove the unix term setting an let it fall back to the default linux vim works again

so seem the vim now in macOS 13.2 is passing ESC[?4m when terminus is in xterm mode but terminus is not able to deal with it

titouanmathis commented 1 year ago

if I remove the unix term setting an let it fall back to the default linux vim works again

Thanks for the tip @dpslwk, it worked for me too.

randy3k commented 1 year ago

https://github.com/randy3k/Terminus/commit/fea994450e568292d233e62fddce88b264d7f05d should fit it. Please re-open the issue if it doesn't.

mikesun commented 1 year ago

@randy3k Will there be a new release on packagecontrol.io that has this fix?

falsefalse commented 1 year ago

This fix promptly breaks vim on 12.6.3 :) @randy3k

Disabling "unix_term": "xterm-256color" fixes it back

VIM - Vi IMproved 9.0 (2022 Jun 28, compiled Dec 12 2022 20:03:56)
macOS version - arm64
Included patches: 1-1023
Compiled by root@apple.com
Traceback (most recent call last):
  File "./python3.3/threading.py", line 901, in _bootstrap_inner
  File "./python3.3/threading.py", line 858, in run
  File "/Users/falsefalse/Library/Application Support/Sublime Text 3/Installed Packages/Terminus.sublime-package/terminus/terminal.py", line 164, in renderer
    feed_data()
  File "/Users/falsefalse/Library/Application Support/Sublime Text 3/Installed Packages/Terminus.sublime-package/terminus/terminal.py", line 159, in feed_data
    self.stream.feed(data[0])
  File "/Users/falsefalse/Library/Application Support/Sublime Text 3/Installed Packages/Terminus.sublime-package/terminus/ptty.py", line 796, in feed
    yield_what = send(data[offset:offset + 1])
  File "/Users/falsefalse/Library/Application Support/Sublime Text 3/Installed Packages/Terminus.sublime-package/terminus/ptty.py", line 737, in _parser_fsm
    csi_dispatch[char](*params, private=True)
TypeError: select_graphic_rendition() got an unexpected keyword argument 'private'
randy3k commented 1 year ago

Let me publish a new release.