7

How do I move and resize the xfce4-terminal by command line?

The problem is that the command echo -ne '\e[3;0;0t' does not re-position my xfce4-terminal and has no apparent affect. man xfce4-terminal and other answers suggest it should.

xfce4-terminal emulates the xterm application developed by the X Consortium. In turn, the xterm application emulates the DEC VT102 terminal and also supports the DEC VT220 escape sequences.

http://invisible-island.net/xterm/ctlseqs/ctlseqs.html

http://rtfm.etla.org/xterm/ctlseq.html

The goal is to write a script that creates a few terminals and sets up my working environment without needing to click and resize my terminals to my comfort.

What does work is echo -ne '\e[8;40;80t' which the causes the terminal to resize correctly. So why not moving the window?


Other information that I am unsure may affect anything:

I have tried other numbers such as the sequence '\e[3;100;100t' but nothing seems to relocate the terminal window.

I am actually running ubuntu and installed and launch with xfce4 after unity started having issues from an update.

xfce4-terminal 0.6.3 (Xfce 4.10)

3

1 Answer 1

2

The man page for xfce4-terminal specifies using the --geometry option to set the size and placement of a terminal.

This flag uses the options "-geometry WIDTHxHEIGHT+XOFF+YOFF (where WIDTH, HEIGHT, XOFF, and YOFF are numbers) for specifying a preferred size and location for this application's main window."

Refer to the "Geometry Specifications" section of the man page for X (man X).

Here are several examples of xterm placement:

  1. Place a short and wide terminal window on upper left-hand side of the display:

    xfce4-terminal --geometry 140x20+50+50

  2. Place a square terminal window in the lower left-hand corner of the display:

    xfce4-terminal --geometry 100x40+40+500

  3. Place a square terminal window in the upper right-hand corner of the display:

    xfce4-terminal --geometry 100x40+1500+40

  4. Place a short and wide terminal window on lower right-hand side of the display:

    xfce4-terminal --geometry 140x20+1500+500

If you would like to make this setting permanent, follow these instructions:

"copy the terminal launcher (terminal's .desktop file) from /usr/share/applications/ to ~/.local/share/applications/ and edit the Exec field accordingly" as mentioned in the answer here.

1
  • This is ok, but I don't really think this 'fully' answer's the OP's question. This obviously works for spawning new terminals (with the --geometry flag, so +1 for that part) but how can you resize/move the current terminal? I have found resize -s <rows> <cols> also works, but I can't find how to re-position the current terminal (lets say while a script is running so opening a new terminal is not really an option.).... is it possible? Dec 7, 2017 at 8:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.