Get user input using term.inkey to prevent /n printing at end.

def input_by_key():
    """Get user input using term.inkey to prevent /n printing at end."""
    usr_inp = ''
    input_valid = True
    input_flush()
    with term.cbreak():
        while input_valid:
            ui_print("\033[?25h")  # cursor on
            key_raw = term.inkey()
            if key_raw.name == "KEY_ENTER":
                input_valid = False
                ui_print("\033[?25l")  # cursor off
                break
            if key_raw.name == 'KEY_DELETE':
                ui_del_char(len(usr_inp))
                usr_inp = usr_inp[:-1]
            if not key_raw.is_sequence:
                usr_inp += key_raw
                ui_print(key_raw)
    if not usr_inp:
        ui_print("\033[D")
    return usr_inp