Decide whether or not a terminal can be resized.
[profile.git] / .profile.d / resize.bashrc
diff --git a/.profile.d/resize.bashrc b/.profile.d/resize.bashrc
new file mode 100644 (file)
index 0000000..e74dbc5
--- /dev/null
@@ -0,0 +1,18 @@
+# Can we resize this window?
+case "$TERM" in
+  # Terminals we KNOW can't be resized.
+  cygwin|linux|sun-color)
+    export RESIZABLE=0
+  ;;
+
+  # Terminals we CANNOT know about.
+  screen*)
+    [ "$RESIZABLE" = "0" ] || RESIZABLE="$TERM"
+    export RESIZABLE
+  ;;
+
+  # Anything else we'll assume can be.
+  *)
+    export RESIZABLE="$TERM"
+  ;;
+esac