Set number of rows for gnome-terminal or other emulatorsChange the number of rows and columns in the TTYSTTY:...

reconstruction filter - How does it actually work?

Wand of the War Mage spellcasting focus and bonus interaction with multiclassing

Can I change the license of a forked project to the MIT if the license of the parent project has changed from the GPL to the MIT?

Can you place a support header in the ceiling?

Reading line from terminal in expl3

How long until two planets become one?

Does dual boot harm a laptop battery or reduce its life?

If Trump gets impeached, how long would Pence be president?

What container to use to store developer concentrate?

Desktop app status bar: Notification vs error message

How can I kill my goat?

Struggling with cyclical dependancies in unit tests

Anti-cheating: should there be a limit to a number of toilet breaks per game per player?

What language is Raven using for her attack in the new 52?

Did the Americans trade destroyers in the "destroyer deal" that they would later need themselves?

Japanese reading of an integer

Is there a wealth gap in Boston where the median net worth of white households is $247,500 while the median net worth for black families was $8?

Introducing Tetronogram!

What is the most efficient way to write 'for' loops in Matlab?

Why is it "on the inside" and not "in the inside"?

What do I do with a party that is much stronger than their level?

8086 stack segment and avoiding overflow in interrupts

How to store my pliers and wire cutters on my desk?

What happens when a flying sword is killed?



Set number of rows for gnome-terminal or other emulators


Change the number of rows and columns in the TTYSTTY: How can I set rows/columns to its supported maximum?How to change font-size, number of rows / columns in the consoleDifference between the terminal file and the terminal screenSet starting directory for gnome-terminal profileSet a custom icon for gnome-terminalgnome-terminal cmd leaving processes open after closing parent windowHow do I determine the number of rows and columns in a gnome-terminal window while resizing?Capture tmux status bar contentMove terminal typed input to new line when console application/script displays output textgnome-terminal issue related to tty configurationWhy do terminal emulators still have screen flicker?Diagnostics for Linux terminal settings






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}







1















I'm aware there exists stty, which allows to set number of rows in a virtual console, such as tty1. However, this does not seem to work with gnome-terminal or xterm. The question therefore is, how would I limit number of rows in a terminal emulator regardless of the window size? In other words, if with stty rows 20 in tty1 I can see output starting to roll up to 20th row (instead of default 34 on my machine), how would I achieve same thing with a terminal emulator?










share|improve this question

















bumped to the homepage by Community 58 mins ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.

















  • relevant: askubuntu.com/questions/4371/… and help.gnome.org/users/gnome-terminal/stable/…

    – Sebastian
    Sep 25 '14 at 7:41




















1















I'm aware there exists stty, which allows to set number of rows in a virtual console, such as tty1. However, this does not seem to work with gnome-terminal or xterm. The question therefore is, how would I limit number of rows in a terminal emulator regardless of the window size? In other words, if with stty rows 20 in tty1 I can see output starting to roll up to 20th row (instead of default 34 on my machine), how would I achieve same thing with a terminal emulator?










share|improve this question

















bumped to the homepage by Community 58 mins ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.

















  • relevant: askubuntu.com/questions/4371/… and help.gnome.org/users/gnome-terminal/stable/…

    – Sebastian
    Sep 25 '14 at 7:41
















1












1








1








I'm aware there exists stty, which allows to set number of rows in a virtual console, such as tty1. However, this does not seem to work with gnome-terminal or xterm. The question therefore is, how would I limit number of rows in a terminal emulator regardless of the window size? In other words, if with stty rows 20 in tty1 I can see output starting to roll up to 20th row (instead of default 34 on my machine), how would I achieve same thing with a terminal emulator?










share|improve this question
















I'm aware there exists stty, which allows to set number of rows in a virtual console, such as tty1. However, this does not seem to work with gnome-terminal or xterm. The question therefore is, how would I limit number of rows in a terminal emulator regardless of the window size? In other words, if with stty rows 20 in tty1 I can see output starting to roll up to 20th row (instead of default 34 on my machine), how would I achieve same thing with a terminal emulator?







terminal gnome-terminal stty






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited May 22 '16 at 0:46









Thomas Dickey

55.1k5 gold badges111 silver badges187 bronze badges




55.1k5 gold badges111 silver badges187 bronze badges










asked Sep 25 '14 at 7:39









Sergiy KolodyazhnyySergiy Kolodyazhnyy

11.1k4 gold badges27 silver badges68 bronze badges




11.1k4 gold badges27 silver badges68 bronze badges






bumped to the homepage by Community 58 mins ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.









bumped to the homepage by Community 58 mins ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.







bumped to the homepage by Community 58 mins ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.















  • relevant: askubuntu.com/questions/4371/… and help.gnome.org/users/gnome-terminal/stable/…

    – Sebastian
    Sep 25 '14 at 7:41





















  • relevant: askubuntu.com/questions/4371/… and help.gnome.org/users/gnome-terminal/stable/…

    – Sebastian
    Sep 25 '14 at 7:41



















relevant: askubuntu.com/questions/4371/… and help.gnome.org/users/gnome-terminal/stable/…

– Sebastian
Sep 25 '14 at 7:41







relevant: askubuntu.com/questions/4371/… and help.gnome.org/users/gnome-terminal/stable/…

– Sebastian
Sep 25 '14 at 7:41












1 Answer
1






active

oldest

votes


















0














@sebastian pointed to these as relevant, but they address only part of the problem:





  • Change default width of gnome-terminal and terminator windows (Ubuntu)


  • Terminal sizes (Gnome)


Some of the discussion here is more relevant, but still not helpful:




  • Change the number of rows and columns in the TTY [duplicate]

  • How to change font-size, number of rows / columns on a terminal


When you use stty like this



stty rows 20


you are telling the operating system that your terminal has 20 rows. That may be correct, but if it is not you will see unexpected behavior. With most terminals, if you have something with 25 real lines and tell the system that you have only 20 lines, applications will continue to use the remaining 5 lines.



Linux is unusual here: you can reduce the number of lines shown in the virtual console with that stty command (which makes an interesting effect with a virtual machine). Linux initializes the console to a mode which supports a given number of lines and columns. The stty command tells the console I/O driver to use less of it. A similar command to (attempt to) increase the size beyond the initialized mode limits fails.



The common feature with the first set of links is that there is a preferences dialog in some terminals which lets you select an initial window size. That is (almost) the same as the Linux initialization of the mode for the terminal. But:




  • there is no mention of a method for changing the usual window size (within the initial limits), and

  • there is no mention of a method to ensure that the window size limits remain the same.


The other links are even less relevant, since they are mainly a discussion (some details wrong...) of how to initialize the Linux console mode.



Back to the missing pieces:





  • xterm has a utility resize which (for many terminals) can change the window size. If you type



    resize -s 20 80



    then xterm (and gnome-terminal) will change their window to 20 lines (and 80 columns). Depending on how xterm is compiled, you may have to select the Allow Window Ops menu entry (since the feature is considered a vulnerability by some).



  • preventing your window from being manually resized is harder. If you do not do this, your 20-line resizing is lost by the first time someone (accidentally) resizes the window.


Many window managers allow you to customize individual windows, removing the resize handles. Here are a few links discussing that topic:




  • Disable the 'Resize Window Grippers' in Ubuntu 11.04 Natty Narwhal

  • Getting rid of self-resizing windows in Ubuntu Linux 12.04

  • Prevent GNOME from expanding windows


For setting the initial size of an xterm window, you would use either the -geometry option or the related geometry resource. That uses the X Toolkit, whose settings are described in the X(7) manual page. The section for geometry specification is a good place to continue reading.






share|improve this answer




























  • I'm trying to find documentation on XTerm, and it's not easy. For example, I prefer 25 rows by 80 columns as the default. It's easy enough to Allow Window Ops and run the resize. But how can I configure .Xresources or /etc/X11/app-defaults/Xterm to make this happen from the get-go?

    – Adrian Keister
    Sep 29 '18 at 15:08














Your Answer








StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "106"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f157405%2fset-number-of-rows-for-gnome-terminal-or-other-emulators%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









0














@sebastian pointed to these as relevant, but they address only part of the problem:





  • Change default width of gnome-terminal and terminator windows (Ubuntu)


  • Terminal sizes (Gnome)


Some of the discussion here is more relevant, but still not helpful:




  • Change the number of rows and columns in the TTY [duplicate]

  • How to change font-size, number of rows / columns on a terminal


When you use stty like this



stty rows 20


you are telling the operating system that your terminal has 20 rows. That may be correct, but if it is not you will see unexpected behavior. With most terminals, if you have something with 25 real lines and tell the system that you have only 20 lines, applications will continue to use the remaining 5 lines.



Linux is unusual here: you can reduce the number of lines shown in the virtual console with that stty command (which makes an interesting effect with a virtual machine). Linux initializes the console to a mode which supports a given number of lines and columns. The stty command tells the console I/O driver to use less of it. A similar command to (attempt to) increase the size beyond the initialized mode limits fails.



The common feature with the first set of links is that there is a preferences dialog in some terminals which lets you select an initial window size. That is (almost) the same as the Linux initialization of the mode for the terminal. But:




  • there is no mention of a method for changing the usual window size (within the initial limits), and

  • there is no mention of a method to ensure that the window size limits remain the same.


The other links are even less relevant, since they are mainly a discussion (some details wrong...) of how to initialize the Linux console mode.



Back to the missing pieces:





  • xterm has a utility resize which (for many terminals) can change the window size. If you type



    resize -s 20 80



    then xterm (and gnome-terminal) will change their window to 20 lines (and 80 columns). Depending on how xterm is compiled, you may have to select the Allow Window Ops menu entry (since the feature is considered a vulnerability by some).



  • preventing your window from being manually resized is harder. If you do not do this, your 20-line resizing is lost by the first time someone (accidentally) resizes the window.


Many window managers allow you to customize individual windows, removing the resize handles. Here are a few links discussing that topic:




  • Disable the 'Resize Window Grippers' in Ubuntu 11.04 Natty Narwhal

  • Getting rid of self-resizing windows in Ubuntu Linux 12.04

  • Prevent GNOME from expanding windows


For setting the initial size of an xterm window, you would use either the -geometry option or the related geometry resource. That uses the X Toolkit, whose settings are described in the X(7) manual page. The section for geometry specification is a good place to continue reading.






share|improve this answer




























  • I'm trying to find documentation on XTerm, and it's not easy. For example, I prefer 25 rows by 80 columns as the default. It's easy enough to Allow Window Ops and run the resize. But how can I configure .Xresources or /etc/X11/app-defaults/Xterm to make this happen from the get-go?

    – Adrian Keister
    Sep 29 '18 at 15:08
















0














@sebastian pointed to these as relevant, but they address only part of the problem:





  • Change default width of gnome-terminal and terminator windows (Ubuntu)


  • Terminal sizes (Gnome)


Some of the discussion here is more relevant, but still not helpful:




  • Change the number of rows and columns in the TTY [duplicate]

  • How to change font-size, number of rows / columns on a terminal


When you use stty like this



stty rows 20


you are telling the operating system that your terminal has 20 rows. That may be correct, but if it is not you will see unexpected behavior. With most terminals, if you have something with 25 real lines and tell the system that you have only 20 lines, applications will continue to use the remaining 5 lines.



Linux is unusual here: you can reduce the number of lines shown in the virtual console with that stty command (which makes an interesting effect with a virtual machine). Linux initializes the console to a mode which supports a given number of lines and columns. The stty command tells the console I/O driver to use less of it. A similar command to (attempt to) increase the size beyond the initialized mode limits fails.



The common feature with the first set of links is that there is a preferences dialog in some terminals which lets you select an initial window size. That is (almost) the same as the Linux initialization of the mode for the terminal. But:




  • there is no mention of a method for changing the usual window size (within the initial limits), and

  • there is no mention of a method to ensure that the window size limits remain the same.


The other links are even less relevant, since they are mainly a discussion (some details wrong...) of how to initialize the Linux console mode.



Back to the missing pieces:





  • xterm has a utility resize which (for many terminals) can change the window size. If you type



    resize -s 20 80



    then xterm (and gnome-terminal) will change their window to 20 lines (and 80 columns). Depending on how xterm is compiled, you may have to select the Allow Window Ops menu entry (since the feature is considered a vulnerability by some).



  • preventing your window from being manually resized is harder. If you do not do this, your 20-line resizing is lost by the first time someone (accidentally) resizes the window.


Many window managers allow you to customize individual windows, removing the resize handles. Here are a few links discussing that topic:




  • Disable the 'Resize Window Grippers' in Ubuntu 11.04 Natty Narwhal

  • Getting rid of self-resizing windows in Ubuntu Linux 12.04

  • Prevent GNOME from expanding windows


For setting the initial size of an xterm window, you would use either the -geometry option or the related geometry resource. That uses the X Toolkit, whose settings are described in the X(7) manual page. The section for geometry specification is a good place to continue reading.






share|improve this answer




























  • I'm trying to find documentation on XTerm, and it's not easy. For example, I prefer 25 rows by 80 columns as the default. It's easy enough to Allow Window Ops and run the resize. But how can I configure .Xresources or /etc/X11/app-defaults/Xterm to make this happen from the get-go?

    – Adrian Keister
    Sep 29 '18 at 15:08














0












0








0







@sebastian pointed to these as relevant, but they address only part of the problem:





  • Change default width of gnome-terminal and terminator windows (Ubuntu)


  • Terminal sizes (Gnome)


Some of the discussion here is more relevant, but still not helpful:




  • Change the number of rows and columns in the TTY [duplicate]

  • How to change font-size, number of rows / columns on a terminal


When you use stty like this



stty rows 20


you are telling the operating system that your terminal has 20 rows. That may be correct, but if it is not you will see unexpected behavior. With most terminals, if you have something with 25 real lines and tell the system that you have only 20 lines, applications will continue to use the remaining 5 lines.



Linux is unusual here: you can reduce the number of lines shown in the virtual console with that stty command (which makes an interesting effect with a virtual machine). Linux initializes the console to a mode which supports a given number of lines and columns. The stty command tells the console I/O driver to use less of it. A similar command to (attempt to) increase the size beyond the initialized mode limits fails.



The common feature with the first set of links is that there is a preferences dialog in some terminals which lets you select an initial window size. That is (almost) the same as the Linux initialization of the mode for the terminal. But:




  • there is no mention of a method for changing the usual window size (within the initial limits), and

  • there is no mention of a method to ensure that the window size limits remain the same.


The other links are even less relevant, since they are mainly a discussion (some details wrong...) of how to initialize the Linux console mode.



Back to the missing pieces:





  • xterm has a utility resize which (for many terminals) can change the window size. If you type



    resize -s 20 80



    then xterm (and gnome-terminal) will change their window to 20 lines (and 80 columns). Depending on how xterm is compiled, you may have to select the Allow Window Ops menu entry (since the feature is considered a vulnerability by some).



  • preventing your window from being manually resized is harder. If you do not do this, your 20-line resizing is lost by the first time someone (accidentally) resizes the window.


Many window managers allow you to customize individual windows, removing the resize handles. Here are a few links discussing that topic:




  • Disable the 'Resize Window Grippers' in Ubuntu 11.04 Natty Narwhal

  • Getting rid of self-resizing windows in Ubuntu Linux 12.04

  • Prevent GNOME from expanding windows


For setting the initial size of an xterm window, you would use either the -geometry option or the related geometry resource. That uses the X Toolkit, whose settings are described in the X(7) manual page. The section for geometry specification is a good place to continue reading.






share|improve this answer















@sebastian pointed to these as relevant, but they address only part of the problem:





  • Change default width of gnome-terminal and terminator windows (Ubuntu)


  • Terminal sizes (Gnome)


Some of the discussion here is more relevant, but still not helpful:




  • Change the number of rows and columns in the TTY [duplicate]

  • How to change font-size, number of rows / columns on a terminal


When you use stty like this



stty rows 20


you are telling the operating system that your terminal has 20 rows. That may be correct, but if it is not you will see unexpected behavior. With most terminals, if you have something with 25 real lines and tell the system that you have only 20 lines, applications will continue to use the remaining 5 lines.



Linux is unusual here: you can reduce the number of lines shown in the virtual console with that stty command (which makes an interesting effect with a virtual machine). Linux initializes the console to a mode which supports a given number of lines and columns. The stty command tells the console I/O driver to use less of it. A similar command to (attempt to) increase the size beyond the initialized mode limits fails.



The common feature with the first set of links is that there is a preferences dialog in some terminals which lets you select an initial window size. That is (almost) the same as the Linux initialization of the mode for the terminal. But:




  • there is no mention of a method for changing the usual window size (within the initial limits), and

  • there is no mention of a method to ensure that the window size limits remain the same.


The other links are even less relevant, since they are mainly a discussion (some details wrong...) of how to initialize the Linux console mode.



Back to the missing pieces:





  • xterm has a utility resize which (for many terminals) can change the window size. If you type



    resize -s 20 80



    then xterm (and gnome-terminal) will change their window to 20 lines (and 80 columns). Depending on how xterm is compiled, you may have to select the Allow Window Ops menu entry (since the feature is considered a vulnerability by some).



  • preventing your window from being manually resized is harder. If you do not do this, your 20-line resizing is lost by the first time someone (accidentally) resizes the window.


Many window managers allow you to customize individual windows, removing the resize handles. Here are a few links discussing that topic:




  • Disable the 'Resize Window Grippers' in Ubuntu 11.04 Natty Narwhal

  • Getting rid of self-resizing windows in Ubuntu Linux 12.04

  • Prevent GNOME from expanding windows


For setting the initial size of an xterm window, you would use either the -geometry option or the related geometry resource. That uses the X Toolkit, whose settings are described in the X(7) manual page. The section for geometry specification is a good place to continue reading.







share|improve this answer














share|improve this answer



share|improve this answer








edited Sep 29 '18 at 15:34

























answered May 22 '16 at 0:45









Thomas DickeyThomas Dickey

55.1k5 gold badges111 silver badges187 bronze badges




55.1k5 gold badges111 silver badges187 bronze badges
















  • I'm trying to find documentation on XTerm, and it's not easy. For example, I prefer 25 rows by 80 columns as the default. It's easy enough to Allow Window Ops and run the resize. But how can I configure .Xresources or /etc/X11/app-defaults/Xterm to make this happen from the get-go?

    – Adrian Keister
    Sep 29 '18 at 15:08



















  • I'm trying to find documentation on XTerm, and it's not easy. For example, I prefer 25 rows by 80 columns as the default. It's easy enough to Allow Window Ops and run the resize. But how can I configure .Xresources or /etc/X11/app-defaults/Xterm to make this happen from the get-go?

    – Adrian Keister
    Sep 29 '18 at 15:08

















I'm trying to find documentation on XTerm, and it's not easy. For example, I prefer 25 rows by 80 columns as the default. It's easy enough to Allow Window Ops and run the resize. But how can I configure .Xresources or /etc/X11/app-defaults/Xterm to make this happen from the get-go?

– Adrian Keister
Sep 29 '18 at 15:08





I'm trying to find documentation on XTerm, and it's not easy. For example, I prefer 25 rows by 80 columns as the default. It's easy enough to Allow Window Ops and run the resize. But how can I configure .Xresources or /etc/X11/app-defaults/Xterm to make this happen from the get-go?

– Adrian Keister
Sep 29 '18 at 15:08


















draft saved

draft discarded




















































Thanks for contributing an answer to Unix & Linux Stack Exchange!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f157405%2fset-number-of-rows-for-gnome-terminal-or-other-emulators%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Taj Mahal Inhaltsverzeichnis Aufbau | Geschichte | 350-Jahr-Feier | Heutige Bedeutung | Siehe auch |...

Baia Sprie Cuprins Etimologie | Istorie | Demografie | Politică și administrație | Arii naturale...

Nicolae Petrescu-Găină Cuprins Biografie | Opera | In memoriam | Varia | Controverse, incertitudini...