fixed the issue of displaying some items that have too many texts: we cut it off based on the width of the terminal screen
replace the get_terminal_size with a better implementation, easier