2

I'm trying to write a bash-script that resizes my KDE-Konsole terminal-window when started. But I can't get it to work. VT-Terminal-codes don't seem to work properly.

$ echo -e "\e[8;2;20t" shrinks the used area of the terminal-window correctly, but leaves the window-size unchanged.

Is there any way to shrink the Konsole-window with a bash-script?

2 Answers 2

0

No, there is not.

First, what makes you think that these are DEC VT escape sequences? A real terminal doesn't have a GUI window around it that can be resized.

What these are are escape sequences recognized by the dtterm terminal emulator, for window management, which the xterm terminal emulator supports for compatibility.

The konsole terminal emulator only supports supports some of what xterm supports. It is not fully xterm-compatible let alone dtterm-compatible. Specifically, in this case, it supports CSI 8 ; H ; W t, but not CSI 4 ; H ; W t.

Further reading

1
  • 2
    okay. so there is really no way of resizing a window? my question was not necessarily limited to escape-sequences.
    – beesteak
    Mar 9, 2014 at 22:44
0

You can use xdotool. I got it with apt-get install xdotool in Ubuntu.

The basic command may be something like:

xdotool windowsize `xdotool search Konsole` 60% 50%

This is only a starting point, far from being foolproof (e.g. if xdotool search Konsole doesn't return exactly one number then the outer command will break). Modify and expand it to your needs. In case you are not familiar with backtick, follow this link.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .