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

Terminalkit for mac. #154

Closed
el2zay opened this issue Feb 16, 2021 · 26 comments
Closed

Terminalkit for mac. #154

el2zay opened this issue Feb 16, 2021 · 26 comments

Comments

@el2zay
Copy link

el2zay commented Feb 16, 2021

Hello,
There is a problem with Terminal Kit on Mac, it is impossible to erase carcaters and sometimes the controls go sideways. As you can see from the screenshot.

Is it possible to correct this?
cordially
Elie.

@el2zay
Copy link
Author

el2zay commented Feb 16, 2021

Capture d’écran 2021-02-16 à 21 11 33
This is the screen

@cronvel
Copy link
Owner

cronvel commented Feb 17, 2021

@Elie404 Hello,
Can you please execute /sample/detect-terminal-test.js and paste the output here?
Can you tell me which terminal app you use, and if SSH is involved?

@el2zay
Copy link
Author

el2zay commented Feb 18, 2021

Hi,
Thanks for your reply.
Capture d’écran 2021-02-18 à 17 06 47
You want this?

@cronvel
Copy link
Owner

cronvel commented Feb 19, 2021

@Elie404 No I want the execution's output of this script! Run the script, copy and paste the output!
Run, not open.

@imf
Copy link

imf commented Mar 6, 2021

Hi @cronvel I am having the same problems, with zsh.

Here is the output you were asking for:

imf@krypton sample % node ./detect-terminal-test.js

== OS and Environment Variables ==

Node version: v14.15.3
OS platform: darwin
OS type: Darwin
OS release: 20.2.0
OS version: Darwin Kernel Version 20.2.0: Wed Dec 2 20:40:21 PST 2020; root:xnu-7195.60.75~1/RELEASE_ARM64_T8101
$TERM: xterm-256color
$COLORTERM: (undefined)
$VTE_VERSION: (undefined)
$TERM_PROGRAM: Apple_Terminal

== Using simple terminal guessing ==

.guessTerminal(): {"isTTY":true,"isSSH":false,"appId":"osx-256color","safe":true,"generic":"osx-256color"}
Terminal name: (undefined)
Terminal app ID: osx-256color
Generic terminal: osx-256color
Config file: osx-256color.js

Support for delta escape sequence: OK
Support for 256 colors: OK
Support for true colors: NO
Support for cursor location request: OK (x: 38, y: 41)
Support for palette request: OK
Issue #116 CURSOR_LOCATION keymap: OK
Issue #116 cursorLocation handler: OK

== Using advanced terminal detection ==

.getParentTerminalInfo(): {"appId":"osx-256color","appName":"Terminal","pid":594,"safe":true}
Terminal name: (undefined)
Terminal app ID: osx-256color
Generic terminal: xterm-256color
Config file: osx-256color.js

Support for delta escape sequence: OK
Support for 256 colors: OK
Support for true colors: NO
Support for cursor location request: OK (x: 38, y: 41)
Support for palette request: OK
Issue #116 CURSOR_LOCATION keymap: OK
Issue #116 cursorLocation handler: OK

@imf
Copy link

imf commented Mar 6, 2021

Also, fwiw, I see the same behavior in bash. I haven't tried this on a non-Apple-silicon Mac to see if it's somehow ARM-related (which would be odd but not unheard-of.) (Happy to test if that's of use.)

The behavior I'm seeing is that, in an input field, backspace doesn't result in the previously entered character being removed.

@imf
Copy link

imf commented Mar 6, 2021

Also, I'm super new to terminal-kit... Is it expected that multiline terminal output would "get dimmer" as the lines go down?

You can see the effect I'm describing here: This multiline ASCII dinosaur is all in a term.bold.grey() block (but other formatting also had the dinosaur disappear:

term.bold.grey(`            __
           / _)
    .-^^^-/ /    
 __/       /
<__.|_|-|_|
`)

...produced this...

Screen Shot 2021-03-05 at 5 36 13 PM

Happy to open a separate issue if that's a separate thing, and I'm good working around it too!

@imf
Copy link

imf commented Mar 6, 2021

Also, same 'no backspace' (and text gradient-y) behavior in iTerm:

imf@krypton Brindisi % node node_modules/terminal-kit/sample/detect-terminal-test.js

== OS and Environment Variables ==

Node version: v14.15.3
OS platform: darwin
OS type: Darwin
OS release: 20.2.0
OS version: Darwin Kernel Version 20.2.0: Wed Dec 2 20:40:21 PST 2020; root:xnu-7195.60.75~1/RELEASE_ARM64_T8101
$TERM: xterm-256color
$COLORTERM: truecolor
$VTE_VERSION: (undefined)
$TERM_PROGRAM: iTerm.app

== Using simple terminal guessing ==

.guessTerminal(): {"isTTY":true,"isSSH":false,"appId":"osx-256color","safe":true,"generic":"osx-256color"}
Terminal name: (undefined)
Terminal app ID: osx-256color
Generic terminal: osx-256color
Config file: osx-256color.js

Support for delta escape sequence: OK
Support for 256 colors: OK
Support for true colors: NO
Support for cursor location request: OK (x: 38, y: 25)
Support for palette request: OK
Issue #116 CURSOR_LOCATION keymap: OK
Issue #116 cursorLocation handler: OK

== Using advanced terminal detection ==

.getParentTerminalInfo(): {"appId":"osx-256color","appName":"iTerm2","pid":90325,"safe":true}
Terminal name: (undefined)
Terminal app ID: osx-256color
Generic terminal: xterm-256color
Config file: osx-256color.js

Support for delta escape sequence: OK
Support for 256 colors: OK
Support for true colors: NO
Support for cursor location request: OK (x: 38, y: 25)
Support for palette request: OK
Issue #116 CURSOR_LOCATION keymap: OK
Issue #116 cursorLocation handler: OK

imf@krypton Brindisi %

@cronvel
Copy link
Owner

cronvel commented Mar 6, 2021

@imf Thanks for reporting.
Please run also run the script sample/key-test.js, type the backspace key and screenshot the output.

@imf
Copy link

imf commented Mar 8, 2021

Thanks @cronvel

And I did end up testing on Intel hardware, with the same behavior. Note, however, that ^H (manually entered) does "the right thing".

Output below...

Key: DELETE , length: 6 , all matches: [ 'DELETE', 'BACKSPACE' ] , is character: false , codepoint: , buffer: <Buffer 7f>

Screen Shot 2021-03-07 at 6 31 41 PM

@imf
Copy link

imf commented Mar 8, 2021

Reading the docs a little more, I think I see what's happening here... The Backspace key is being interpreted as Delete. I can confirm that, if I move around with the arrow keys, and then hit backspace, it has the default "delete" behavior of deleting the character to the right of the cursor.

@imf
Copy link

imf commented Mar 19, 2021

Is there a resolution for this?

@cronvel
Copy link
Owner

cronvel commented Mar 20, 2021

@imf Hi,

Sorry to be late, I have tons of works IRL.
The problem comes from this file: terminal-kit/lib/termconfig/osx-256color.js, this line: DELETE: '\x7f' should be replaced by BACKSPACE: '\x7f'.

The change is fairly trivial, BUT the thing is that I don't own a MacOS to test what I'm doing. This file was written by a Mac user, and it's hard for me to know if it was a mistake on its end or if there are some conflicts between different Mac terminal apps.

Any dedicated OSX maintainer is more than welcome on this project.

From your report, we can see that your terminal is not sending ^H (which is charcode \x08) but \x7f (also known as ASCII DEL). Linux terminals send either \x08 or \x7f for BACKSPACE, so this is not surprising. DELETE is usually better (not ambigous) when it sends ^[3~ (charcodes: \x1b\x5b\x33\x7e).

If we want to solve this, I need you to test both DELETE and BACKSPACE keys using sample/key-test.js on the most common OSX terminals (at least the one shipped with OSX and iTerm2). Also some terminals offer an option for changing what those keys are generating, so be careful to have the default behavior in your terminal preferences.

@el2zay
Copy link
Author

el2zay commented Mar 20, 2021

Bonjour désolée pour mon absence,
J'ai vu que vous étiez français j'utilise depuis tout à l'heure google traduction mais je ne comprend rien 😅

Du coup pouvez vous m'expliquer ce que vous souhaitez s'il vous plaît?

Elie.

@cronvel
Copy link
Owner

cronvel commented Mar 20, 2021

@Elie404 Je veux simplement que vous exécutiez le programme /sample/detect-terminal-test.js et afficher la sortie. Toutefois la version v2.0.6 devrait régler le problème, donc pensez à d'abord à mettre à jour Terminal-kit.

@cronvel
Copy link
Owner

cronvel commented Mar 20, 2021

@imf Hi again, version v2.0.6 published just now should fix this problem, it has been tested by @dangilkerson on Terminal.app and iTerm2.

@el2zay
Copy link
Author

el2zay commented Mar 20, 2021

== OS and Environment Variables ==

Node version: v14.15.5
OS platform: darwin
OS type: Darwin
OS release: 19.6.0
OS version: Darwin Kernel Version 19.6.0: Tue Jan 12 22:13:05 PST 2021; root:xnu-6153.141.16~1/RELEASE_X86_64
$TERM: xterm-256color
$COLORTERM: (undefined)
$VTE_VERSION: (undefined)
$TERM_PROGRAM: Apple_Terminal


== Using simple terminal guessing ==

.guessTerminal(): {"isTTY":true,"isSSH":false,"appId":"osx-256color","safe":true,"generic":"osx-256color"}
Terminal name: (undefined)
Terminal app ID: osx-256color
Generic terminal: osx-256color
Config file: osx-256color.js

Support for delta escape sequence: OK
Support for 256 colors: OK
Support for true colors: NO
Support for cursor location request: OK (x: 38, y: 24)
Support for palette request: OK
Issue #116 CURSOR_LOCATION keymap: OK
Issue #116 cursorLocation handler: OK


== Using advanced terminal detection ==

.getParentTerminalInfo(): {"appId":"osx-256color","appName":"Terminal","pid":34376,"safe":true}
Terminal name: (undefined)
Terminal app ID: osx-256color
Generic terminal: xterm-256color
Config file: osx-256color.js

Support for delta escape sequence: OK
Support for 256 colors: OK
Support for true colors: NO
Support for cursor location request: OK (x: 38, y: 24)
Support for palette request: OK
Issue #116 CURSOR_LOCATION keymap: OK
Issue #116 cursorLocation handler: OK

J'ai fait la mise à jour je suis bien sous 2.0.6 mais toujours rien.

@el2zay el2zay changed the title Terminal for mac. Terminalkit for mac. Mar 20, 2021
@cronvel
Copy link
Owner

cronvel commented Mar 21, 2021

@Elie404 Fait la même manipulation que j'ai demandé sur ce thread, lance le programme sample/key-test.js et appuie sur BACKSPACE puis DELETE, et poste-moi la sortie du programme.

Sinon tu peux aussi te mettre à iTerm2 qui est mieux supporté par Termnial Kit (car tous les utilisateurs Mac sont dessus) et qui est de toute façon mieux que le terminal de base.

@el2zay
Copy link
Author

el2zay commented Mar 21, 2021

Capture d’écran 2021-03-21 à 13 25 07

Voilà!

@cronvel
Copy link
Owner

cronvel commented Mar 21, 2021

@Elie404 Houlà, t'es sûr que t'es sur la dernière version? Parce qu'elle inclut ce patch qui s'assure que x7f est détecté comme BACKSPACE uniquement, alors que sur ton screenshot on voit bien qu'il y a ambiguïté avec DELETE.

@el2zay
Copy link
Author

el2zay commented Mar 21, 2021

Vous auriez une commande pour connaitre la version?

@cronvel
Copy link
Owner

cronvel commented Mar 21, 2021

@Elie404 npm ls.

@el2zay
Copy link
Author

el2zay commented Mar 21, 2021

image

oulah

@el2zay
Copy link
Author

el2zay commented Mar 21, 2021

image
au final ça a réglé le problème 1 des 2 applications n'était pas à jour c'est pour cela que ça n'avait rien changé.

La 2.0.7 règle bien les problèmes
Merci beaucoup pour votre aide.

@cronvel cronvel closed this as completed Mar 22, 2021
@imf
Copy link

imf commented Mar 28, 2021

Now it was my turn to be away! (I feel you on 'work IRL taking time'. Thanks for all the love you give to this really terrific library.)

I can also verify this fixed!

Happy to help test things that need Mac OS testing... (And sorry from being away from the thread for so long.)

@cronvel
Copy link
Owner

cronvel commented Mar 29, 2021

@imf Thanks!

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

No branches or pull requests

3 participants