Can a script resize it's own mintty console?


Login or Register for Dates, Times and to Reply

 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Can a script resize it's own mintty console?
# 1  
Can a script resize it's own mintty console?

I'm looking for finer granularity than the 20 ANSI escape sequence screen modes. What I'd like to do is have the terminal increase it's own height when I have to show the user a long menu.

Platform is Cygwin 64 running over Win 7 Pro.

Mike

Last edited by Michael Stora; 05-15-2015 at 03:19 PM..
# 2  
You could start another terminal window and define its size by options.
Other than that, best you could achieve, is to virtualy de-/increase width/columns. (COLUMNS=30)

Code:
terminal-appnamel --geometry=240x50

hth
# 3  
This worth a try if it is rows and columns.
Code:
#!/bin/bash
# Set window size down to 66 cols x 32 rows, not tested on mintty but worth a try...
printf "\x1B[8;32;66t"
# Write into the title bar; this DOES work on mintty...
printf "\x1B]0;This is a title name.\x07"

EDIT:
ALSO...
You could put either or both those two lines into your .bash_profile as CygWin uses bash by default.
Assuming mintty can accept the first 'printf' line then it will start up with your choice of rows and columns.

EDIT 2:
The above edit works on 64 bit cygwin using Windows 8.1.

Last edited by wisecracker; 05-16-2015 at 06:26 PM.. Reason: See above...
This User Gave Thanks to wisecracker For This Post:
# 4  
Quote:
Originally Posted by sea
You could start another terminal window and define its size by options.
Other than that, best you could achieve, is to virtualy de-/increase width/columns. (COLUMNS=30)

Code:
terminal-appnamel --geometry=240x50

hth
Thanks but does not work in mintty.

---------- Post updated at 02:42 PM ---------- Previous update was at 02:41 PM ----------

[QUOTE=wisecracker;302944157]This worth a try if it is rows and columns.
Code:
#!/bin/bash
# Set window size down to 66 cols x 32 rows, not tested on mintty but worth a try...
printf "\x1B[8;32;66t"
# Write into the title bar; this DOES work on mintty...
printf "\x1B]0;This is a title name.\x07"

Both work on mintty. Thank you. Where can I learn more about these sequences? I have not seen widow size or title bar documented anywhere and wonder how many more there are.

Mike
# 5  
Quote:
Originally Posted by Michael Stora
Where can I learn more about these sequences? I have not seen widow size or title bar documented anywhere and wonder how many more there are.

Mike
You can read about quite a few of them here Xterm Control Sequences
This User Gave Thanks to Chubler_XL For This Post:
Login or Register for Dates, Times and to Reply

Previous Thread | Next Thread
Thread Tools Search this Thread
Search this Thread:
Advanced Search

Test Your Knowledge in Computers #36
Difficulty: Easy
Moving processes from the main memory of a memory-constrained Linux computer to disk is called 'swapping'.
True or False?

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Simple script for resize, crop and optimize jpg

Hi Friends, I'm trying to create a script that allows me to recursively resize, crop (holding the center of the image) and optimize images jpg, jpeg, png for a specific folder and subfolder with the ability to exclude certain folder and its subdirectory. Again, I should to do with this script:... (3 Replies)
Discussion started by: danjde
3 Replies

2. UNIX for Advanced & Expert Users

Script to automate add/resize datafile in Oracle ASM Storage

Hi all, Could anyone please share ideas or logic on how to automate add/resize datafile in Oracle ASM Storage for Oracle RAC/Single Node databases when any tablespace space alert is trigerred by OEM? Thanks for your help and time on it! Thanks&regards, a1_win Please DON'T use CODE tags... (0 Replies)
Discussion started by: a1_win
0 Replies

3. UNIX for Beginners Questions & Answers

Linux Console for Interactive Input Script

Hi there, How do I enter command to the interactive console. I was able to do it via the first line. What if I have more lines to input into the interactive console from line 3 onwards. Is there a more easier way? (echo -e "load openvas" ; echo -e "openvas_help") | msfconsole ... (4 Replies)
Discussion started by: alvinoo
4 Replies

4. Shell Programming and Scripting

Need a little help with my first shell script. Basic image resize script...

Hey everyone, just now joined because I didn't want to go onto Ubuntu forums and start asking about how to write shell scripts. Seems like this is a pretty active forum for exactly what I need. I'm trying to modify a shell script I found online, the end goal is to have it find all files in the... (9 Replies)
Discussion started by: mozzles
9 Replies

5. Linux

Linux extacting msg from script to console

how to get the outout from script to console. i am running one script msg.sh using cron job every suday midnight. as soon as i logged in i want to see the staus is service started or service failed on console. what command i need to add to script ? msg.sh #!/bin/bash if then echo... (1 Reply)
Discussion started by: saku
1 Replies

6. Shell Programming and Scripting

Output of echo $$ differs in Script than console

Hi All, I have a very basic query for 'echo $$' command. When I am executing echo $$ on console then it is giving different output than the execution of echo $$ in a script. Console Output: ------------------------- bash-3.2$ echo $$ 15610 bash-3.2$ In Script:... (3 Replies)
Discussion started by: manishdivs
3 Replies

7. Windows & DOS: Issues & Discussions

How to install mintty?

I already have CygWin installed on my PC. However, I would like to use mintty instead of the CygWin Bash Shell. Do I need to reinstall the whole thing? Thanks! ---------- Post updated at 12:13 PM ---------- Previous update was at 11:56 AM ---------- I just had to move the mintty application... (0 Replies)
Discussion started by: Xterra
0 Replies

8. UNIX for Dummies Questions & Answers

Windows to Linux remote console using VNC brings up blank console screen with only mouse pointer

:confused:Hi This was installed on the Linux box a few weeks back by a guy that no longer works for us. All worked fine until last week. Now when we connect its just a blank screen with no icons. I get a whole bunch of errors when starting the service too: Tue Feb 23 14:29:45 2010 ... (1 Reply)
Discussion started by: wbdevilliers
1 Replies

9. Solaris

script hangs when outputing to /dev/console

I am running solaris 8 on a sparcs box. The system is connected to a lightwave console server. I have a script that hangs when sending output to '/dev/console'. Any ideas? -V (2 Replies)
Discussion started by: vada010
2 Replies

10. Shell Programming and Scripting

How to Open Shell Script from X-Manager Console

Dear All, I have a shell script. which has the read, write & execute permissions. I am entering from X-Manager Console. OS Details are: SunOS P382XLRTY 5.9 Generic_118558-34 sun4u sparc SUNW,Sun-Fire-480R Step1: Double Click on Home Folder, it will be opened. Step2: Double Click on... (2 Replies)
Discussion started by: hanu_oracle
2 Replies

Featured Tech Videos