Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

OT: setting the dimensions of xterm terminal

107 views
Skip to first unread message

Sivaram Neelakantan

unread,
Aug 22, 2021, 12:12:21 PM8/22/21
to

In a fit of madness, I enabled X server in WSL ubuntu on my laptop.
As my laptop keeps changing quite frequently which means the screen
size keeps changing too and hence the xterm starts off at a different
position in each laptop. Now, I do know how to set the dimensions in
.[Xx]res* files but I do have to keep fiddling the numbers to get it
right so that it's offset by a few points from the top left.

Does anyone have a script or a function to compute the screen size and
suggest a typical 'fullwidth' by 40 rows size for xterm starting at the
top left?

For some reason, I've got obsessed with xterm starting off at random
positions on the screen and could only get part way to at least
iteratively, manually change the resource files repeatedly to get it
right.

!use xwininfo to get geometry
xterm*VT100.geometry: 172x39+0+23 !painfully identified as fullwidth
! was spilling over beyond screen dimensions. 39 because windows
taskbar overlays last row.


What do you do?

sivaram
--

Janis Papanagnou

unread,
Aug 22, 2021, 1:08:04 PM8/22/21
to
On 22.08.2021 18:12, Sivaram Neelakantan wrote:
>
> In a fit of madness, I enabled X server in WSL ubuntu on my laptop.
> As my laptop keeps changing quite frequently which means the screen
> size keeps changing too and hence the xterm starts off at a different
> position in each laptop. Now, I do know how to set the dimensions in
> .[Xx]res* files but I do have to keep fiddling the numbers to get it
> right so that it's offset by a few points from the top left.
>
> Does anyone have a script or a function to compute the screen size and
> suggest a typical 'fullwidth' by 40 rows size for xterm starting at the
> top left?

I am a bit confused about what you try to achieve here with the
172x39+0+23 setting and full-screen.

If I want full-screen (with an xterm) I use option '-fullscreen'.
I also don't need offsets because the menu bar gets not convered.
And how many columns can be displayed depends also on font size.

Could it be that you see an issue where there is none?

Janis

Sivaram Neelakantan

unread,
Aug 23, 2021, 2:11:30 AM8/23/21
to
On Sun, Aug 22 2021,Janis Papanagnou wrote:


[snipped 15 lines]

>
> If I want full-screen (with an xterm) I use option '-fullscreen'.
> I also don't need offsets because the menu bar gets not convered.
> And how many columns can be displayed depends also on font size.
>
> Could it be that you see an issue where there is none?
>

-fs is making xterm spill beyond the right screen frame and below the
windows taskbar which I don't know how to fix or resolve and hence
those magic fiddly numbers.

[snipped 17 lines]

sivaram
--

Janis Papanagnou

unread,
Aug 23, 2021, 5:00:47 AM8/23/21
to
I cannot tell why the "fontsize" option (-fs) does that in your
environment, in mine there's no "spilling". (I mentioned -fs
only because the font size influences screen size if rows/columns
are defined; "172x39" might fit on screen with one font size and
not fit with another one.)

But as I understand you just wanted full-screen mode, i.e.

xterm -fullscreen

Or did I miss a requirement in your original post?

Janis

>
> [snipped 17 lines]
>
> sivaram
>

Sivaram Neelakantan

unread,
Aug 23, 2021, 8:46:44 AM8/23/21
to
On Mon, Aug 23 2021,Janis Papanagnou wrote:


[snipped 17 lines]

>
> I cannot tell why the "fontsize" option (-fs) does that in your
> environment, in mine there's no "spilling". (I mentioned -fs
> only because the font size influences screen size if rows/columns
> are defined; "172x39" might fit on screen with one font size and
> not fit with another one.)
>
> But as I understand you just wanted full-screen mode, i.e.
>
> xterm -fullscreen
>
> Or did I miss a requirement in your original post?
>
> Janis
>

oh wait, I messed up my requirements. If I launch xterm in
fullscreen, it spills over on the right and also below the taskbar of
Windows(I run wsl ubuntu). To fix that, I had to fiddle the numbers
to position xterm where I want. And was asking for any function that
computes dimensions for arbitrary laptop screen sizes as I gave up on
finding out why fullscreen was overflowing.

And you're right that changing font size from 10 to 12 does make it wonky.

Net net, ignoring why fullscreen makes it overflow, is there any
function/script that can generate a dimension set worth using?

sivaram
--

Javier

unread,
Aug 25, 2021, 5:10:24 PM8/25/21
to
Sivaram Neelakantan <nsivar...@gmail.com> wrote:
> Net net, ignoring why fullscreen makes it overflow, is there any
> function/script that can generate a dimension set worth using?

From xterm(1):

-maximized
This option indicates that xterm should ask the window manager
to maximize its layout on startup. This corresponds to the
maximized resource.

Maximizing is not the reverse of iconifying; it is possible to
do both with certain window managers.

It should work all right thing on any window manager, or at least in
those that are ICCCM compliant.

Keith Thompson

unread,
Aug 25, 2021, 6:32:14 PM8/25/21
to
In the environments I use most often (Cygwin on Windows 10 and
Cinnamon on Ubuntu), `xterm -maximized` does *not* do the same
thing as launching an xterm and then maximizing it.

`xterm -maximized` creates an xterm window that's big enough to fill
(almost) the entire display, but it's still an ordinary window that I
can move around and resize. With or without the `-maximized` option, if
I click the maximize button (typically in the upper right next to the
close button) or double-click the title bar, or use an appropriate
keyboard shortcut, I get a full-screen window that still has a title
bar, but I can't move or resize it without un-maximizing it.

I don't know if that means these window managers are not
ICCCM compliant. I personally would find it more convenient if
`xterm -maximized` created a true full-screen window, which is
usually what I want. Instead, I generally just launch an xterm
and maximize it manually. It's mildly annoying, but not bad enough
so far to induce me to find a better solution.

--
Keith Thompson (The_Other_Keith) Keith.S.T...@gmail.com
Working, but not speaking, for Philips
void Void(void) { Void(); } /* The recursive call of the void */

Janis Papanagnou

unread,
Aug 25, 2021, 6:44:33 PM8/25/21
to
On 26.08.2021 00:32, Keith Thompson wrote:
> Javier <inv...@invalid.invalid> writes:
>> Sivaram Neelakantan <nsivar...@gmail.com> wrote:
>>> Net net, ignoring why fullscreen makes it overflow, is there any
>>> function/script that can generate a dimension set worth using?
>>
>> From xterm(1):
>>
>> -maximized
>> This option indicates that xterm should ask the window manager
>> to maximize its layout on startup. This corresponds to the
>> maximized resource.
>>
>> Maximizing is not the reverse of iconifying; it is possible to
>> do both with certain window managers.
>>
>> It should work all right thing on any window manager, or at least in
>> those that are ICCCM compliant.
>
> In the environments I use most often (Cygwin on Windows 10 and
> Cinnamon on Ubuntu), `xterm -maximized` does *not* do the same
> thing as launching an xterm and then maximizing it.
>
> `xterm -maximized` creates an xterm window that's big enough to fill
> (almost) the entire display, but it's still an ordinary window that I
> can move around and resize. With or without the `-maximized` option, if
> I click the maximize button (typically in the upper right next to the
> close button) or double-click the title bar, or use an appropriate
> keyboard shortcut, I get a full-screen window that still has a title
> bar, but I can't move or resize it without un-maximizing it.

Funny effect; a 'xterm -maximize' on my system fills one physical
screen, and if I pick its title bar to move it a bit around the
screen size instantly doubles (I have two logical screens running
side by side).

(But the screen-resize function on my Linux has anyway many bugs
that are similar or even more annoying.)

Janis

Javier

unread,
Aug 25, 2021, 7:28:17 PM8/25/21
to
I'm getting the same behaviour in fvwm2. I get an xterm whose size is
the root window + the size of the titlebar. I think a default
maximized size and default positioning policy needs to be defined in
the window manager config. But that would be window-manager specific.

I guess the best is just to write an script for getting the root
window size and calculate teh xterm size from that:

#!/usr/bin/env bash
w=$(xwininfo -root | sed -n '/ Width: /s/ Width: //p')
h=$(xwininfo -root | sed -n '/ Height: /s/ Height: //p')
xterm -fn 10x20 -geometry $((w/10-12))x$((h/20-9))+0+0

There is also xprop which gives more complete information than xwininfo

Javier

unread,
Aug 25, 2021, 7:37:16 PM8/25/21
to
Sivaram Neelakantan <nsivar...@gmail.com> wrote:
>
> -fs is making xterm spill beyond the right screen frame and below the
> windows taskbar which I don't know how to fix or resolve and hence
> those magic fiddly numbers.
>
> [snipped 17 lines]
>
> sivaram

I don't find that a problem. In xterm you can switch between
full-screen and default size with Alt-Enter. The same key combination
that was used for MS-DOS consoles in windows.

Sivaram Neelakantan

unread,
Aug 26, 2021, 8:51:42 AM8/26/21
to
On Wed, Aug 25 2021,Keith Thompson wrote:


[snipped 17 lines]

>
> In the environments I use most often (Cygwin on Windows 10 and
> Cinnamon on Ubuntu), `xterm -maximized` does *not* do the same
> thing as launching an xterm and then maximizing it.
>
> `xterm -maximized` creates an xterm window that's big enough to fill
> (almost) the entire display, but it's still an ordinary window that I
> can move around and resize. With or without the `-maximized` option, if
> I click the maximize button (typically in the upper right next to the
> close button) or double-click the title bar, or use an appropriate
> keyboard shortcut, I get a full-screen window that still has a title
> bar, but I can't move or resize it without un-maximizing it.
>
> I don't know if that means these window managers are not
> ICCCM compliant. I personally would find it more convenient if
> `xterm -maximized` created a true full-screen window, which is
> usually what I want. Instead, I generally just launch an xterm
> and maximize it manually. It's mildly annoying, but not bad enough
> so far to induce me to find a better solution.

this is what I get too.

sivaram
--

Sivaram Neelakantan

unread,
Aug 26, 2021, 8:52:16 AM8/26/21
to
On Wed, Aug 25 2021,Javier wrote:


[snipped 46 lines]

>
> #!/usr/bin/env bash
> w=$(xwininfo -root | sed -n '/ Width: /s/ Width: //p')
> h=$(xwininfo -root | sed -n '/ Height: /s/ Height: //p')
> xterm -fn 10x20 -geometry $((w/10-12))x$((h/20-9))+0+0
>
> There is also xprop which gives more complete information than xwininfo

Thanks, I'll try this out.

sivaram
--

Christian Weisgerber

unread,
Aug 26, 2021, 11:30:10 AM8/26/21
to
On 2021-08-25, Javier <inv...@invalid.invalid> wrote:

> I don't find that a problem. In xterm you can switch between
> full-screen and default size with Alt-Enter.

That's not a standard feature of xterm. Either your setup adds a
key-binding action, or it's a feature of your window manager.

--
Christian "naddy" Weisgerber na...@mips.inka.de

Lew Pitcher

unread,
Aug 26, 2021, 11:40:18 AM8/26/21
to
On Thu, 26 Aug 2021 14:49:58 +0000, Christian Weisgerber wrote:

> On 2021-08-25, Javier <inv...@invalid.invalid> wrote:
>
>> I don't find that a problem. In xterm you can switch between
>> full-screen and default size with Alt-Enter.
>
> That's not a standard feature of xterm. Either your setup adds a
> key-binding action, or it's a feature of your window manager.

I beg to differ. This feature works in (at least) xterm -version X.Org 7.7.0(367),
and is documented in that version's manpage.


XTERM(1) X Window System XTERM(1)

NAME
xterm - terminal emulator for X

SYNOPSIS
xterm [-toolkitoption ...] [-option ...] [shell]

DESCRIPTION
The xterm program is a terminal emulator for the X Window System.
...

Default Key Bindings
The default bindings in the VTxxx window use the SELECT token, which is
set by the selectToClipboard resource. These are for the vt100 widget:
...
Alt <Key>Return:fullscreen() \n\


--
Lew Pitcher
"In Skills, We Trust"
0 new messages