1. Fix:Render not work normally when using terminal through serial port
2. Extract same logic in prompt to utils.
Fix the unit of tty.left to be positive value
Add takeUtil to keypress event
also apply the serial console fix to bottom-bar
Calculate the actual moving length of cursor

Do not use magic number. Actually we can calculate the real text length accurately by (message.length + prompt.rl.line.length).
Merge pull request #172 from akwangho/master

Fix serial console terminal issue and extract same logic to be helper function (#171)