]> arthur.barton.de Git - ax-zsh.git/blobdiff - core/10_terminal/10_terminal.zshrc
10_terminal: Implement "axzsh_resize_terminal COLUMNS LINES"
[ax-zsh.git] / core / 10_terminal / 10_terminal.zshrc
index 614bf3dca86877e06c701bcdae34191edfc2e904..e7c1eecfcb2b41404015c789e6da19217ae7b61f 100644 (file)
@@ -14,6 +14,19 @@ function axzsh_is_utf_terminal {
 }
 alias isutfenv=axzsh_is_utf_terminal
 
+# Test for "modern" terminal
+function axzsh_is_modern_terminal {
+       [[ "$TERM" = screen* ]] && return 0
+       [[ "$TERM" = tmux* ]] && return 0
+       [[ "$TERM" = xterm* ]] && return 0
+       return 1
+}
+
+# Resize terminal window (when possible)
+function axzsh_resize_terminal {
+       printf '\e[8;%d;%dt' "$2" "$1"
+}
+
 # Set terminal title
 
 # Set terminal "hardstatus" and "icon title"
@@ -27,14 +40,6 @@ function axzsh_terminal_set_window_title {
        printf '\e]2;%s\a' "$1"
 }
 
-# Test for "modern" terminal
-function axzsh_is_modern_terminal {
-       [[ "$TERM" = screen* ]] && return 0
-       [[ "$TERM" = tmux* ]] && return 0
-       [[ "$TERM" = xterm* ]] && return 0
-       return 1
-}
-
 # Update terminal titles befor echoing the shell prompt
 function axzsh_terminal_title_precmd {
        axzsh_is_modern_terminal || return