Added term_char support in write_raw