openterm
openterm copied to clipboard
Terminal crash with special character ~
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
Then, if I press backspace twice, the first one delete the space after the :
And the second one makes the app crash.
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).
A relationship with the backspace that crash without command?