openterm icon indicating copy to clipboard operation
openterm copied to clipboard

Terminal crash with special character ~

Open loicwolff opened this issue 7 years ago • 2 comments

Weird bug. When I type ~ on my French logitech keyboard (⌥ + n), iOS waits for another key in case I want to type a special character (e.g. ñ).

When I type ~ in Terminal and press enter, I get this message weird message 1

Then, if I press backspace twice, the first one delete the space after the : weird message 2

And the second one makes the app crash.

loicwolff avatar Jan 14 '18 09:01 loicwolff

I think I have the origin (plus easier to reproduce): if the text cursor moves before the end of the command prompt (in this case, before the space after the ":"), Terminal crashes on line 172 of TerminalView.swift:

 let i = textView.text.distance(from: textView.text.startIndex, to: currentCommandStartIndex)

I reproduced it by moving the cursor with keyboard arrows, then hitting Ctrl-K (to erase the entire line).

holzschu avatar Jan 15 '18 15:01 holzschu

A relationship with the backspace that crash without command?

djerfy avatar Feb 01 '18 20:02 djerfy