Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Bash command to change size of bash window

Tags:

Is there any command to change size of bash window ( for example to set size on 150x90) ? I dont want to change .profile file.

like image 598
Dayanne Avatar asked Mar 09 '11 09:03

Dayanne


People also ask

What is resize in Linux?

Description. Resize prints a shell command for setting the TERM and TERMCAP environment variables to indicate the current size of xterm window from which the command is run.

What does $f mean in bash?

$ man bash | grep -A1 '\-f file$' -f file True if file exists and is a regular file. $ Follow this answer to receive notifications.

How do I Reinit in bash?

How to reload your bash shell? in your ~/. bash_aliases file, you can simply use exec bash which will replace your current shell image with a new one, loading your configuration file and allowing you to use your updated aliases in your current terminal.


2 Answers

Some (but not many) terminals accept the ANSI escape sequence

 \033[8;h;wt 

(where \033 is the ASCII control character ESC, and h and w are height and width in decimal).

For example, in XTerm (after allowing window ops through the Ctrl-RMB menu or the allowWindowOps X resource),

$ printf '\033[8;40;100t' 

will resize the window to 100x40 characters.

like image 56
ephemient Avatar answered Sep 20 '22 14:09

ephemient


$ resize -s 90 150 

see the file manual for more options.

$ man resize 
like image 41
plhn Avatar answered Sep 24 '22 14:09

plhn