Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I honestly cannot replicate either of these behaviors, even using the OS X Terminal application (which definitely causes serious cursor synchronization issues with complex prompts due to incorrect terminal emulation: use iTerm2 instead), and even using an old version of bash (tested on both Linux and OS X).

A) When I hit ^C, I am always seeing a newline occur after the ^C and before my prompt is redrawn. I have tried this with cat (blocked on read) and ssh (blocked on password).

B) When I purposely attempt to cause this (using echo -n and interpreting "a very long command" to mean "long enough that it wrapped to the next line"), hitting up redraws and overwrites part of the prompt in order to guarantee that the position of the prompt will edit correctly.



I have had this problem before, usually when using a repl that gets abnormally terminated. I don't know exactly what causes it and I haven't been able to replicate it deliberately. Long commands alone don't seem to trigger it.


I found the problem occurred most frequently when testing APIs with cURL. Repeat the last command (with output) a few times, and then the cursor loses position when you decide to edit it.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: