diff --git a/src/readline.cc b/src/readline.cc
index d4ef0ad..76a241e 100644
--- a/src/readline.cc
+++ b/src/readline.cc
@@ -258,7 +258,11 @@ void Readline::load_term() {
    /* set terminal output modes */
    st.c_oflag &=~ OCRNL;   /* no CR->NL translation */
    st.c_oflag &=~ ONLRET;  /* no CR filtering away */
+#ifdef __NetBSD__
+   st.c_oflag &=~ OXTABS;   /* no tab->spaces convert */
+#else
    st.c_oflag &=~ XTABS;   /* no tab->spaces convert */
+#endif
 
    /* do output settings on flush */
    if ( tcsetattr(0, TCSADRAIN, &st) ) {