aboutsummaryrefslogtreecommitdiffstats
path: root/.lush/scripts/example.lua
diff options
context:
space:
mode:
authorGravatar BanceDev 2024-09-10 11:29:43 -0400
committerGravatar BanceDev 2024-09-10 11:31:20 -0400
commita0ff5b10f1307c12ffd464850eeec3ec66e2770f (patch)
treecf9347863fe24ca58bdcb9650f5f7bdcbad6e28b /.lush/scripts/example.lua
parentadded coloring to help command (diff)
lua api functions for getting terminal width and height
Diffstat (limited to '')
-rw-r--r--.lush/scripts/example.lua5
1 files changed, 5 insertions, 0 deletions
diff --git a/.lush/scripts/example.lua b/.lush/scripts/example.lua
index c60f99b..0239500 100644
--- a/.lush/scripts/example.lua
+++ b/.lush/scripts/example.lua
@@ -91,3 +91,8 @@ print("Value of EXAMPLE: " .. lush.getenv("EXAMPLE"))
-- you can unset an environment variable with unsetenv
lush.unsetenv("EXAMPLE")
+
+-- you can get the current terminal width(cols) and height(rows)
+-- this function is very useful if you want to make certain kinds of custom prompts in your init.lua
+print("Terminal Columns: " .. lush.termCols())
+print("Terminal Rows: " .. lush.termRows())