[dev] [misc] How to disable scrolling in a vt100

722 views
Skip to first unread message

QUINTIN Guillaume

unread,
Mar 18, 2010, 6:56:50 AM3/18/10
to dwm
Hi all,

This is my problem, maybe one of you knows the answer.
When writing a char in the bottom right corner of the
terminal, it automatically scrolls down. And this I don't
want. So is there a way to disable scrolling in a vt100
using escape sequences ? Or simply tell the terminal
not to got to the next line when writing a char at the end
of a line ?

For the moment, this is what I do: I write the first to lines
and set the scrolling region to lines 1 to 2. Then I can write
the rest of my lines to the terminal. I have googled and only
found how to enable scrolling for the entire display (\033[r).
I also spent several hours in ncurses source code in the
hope of finding the answer but no result so far.

Have you any idea ?

Kind regards,
Guillaume Quintin.

Valentin

unread,
Mar 18, 2010, 8:10:47 AM3/18/10
to dev mail list
On Thu, Mar 18, 2010 at 11:56:50AM +0100, QUINTIN Guillaume wrote:
> is there a way to disable scrolling in a vt100
> using escape sequences ? Or simply tell the terminal
> not to got to the next line when writing a char at the end
> of a line ?

Scroll lock works for me in xterm.

>
> Kind regards,
> Guillaume Quintin.
>

--Valentin

QUINTIN Guillaume

unread,
Mar 18, 2010, 8:58:11 AM3/18/10
to dev mail list
>
> Scroll lock works for me in xterm.
>

What is the escape sequence to lock scroll ?

Valentin

unread,
Mar 18, 2010, 9:00:45 AM3/18/10
to dev mail list
On Thu, Mar 18, 2010 at 01:58:11PM +0100, QUINTIN Guillaume wrote:
> >
> > Scroll lock works for me in xterm.
> >
>
> What is the escape sequence to lock scroll ?
>

No idea, I just hit scroll lock…

Antoni Grzymala

unread,
Mar 18, 2010, 9:10:43 AM3/18/10
to dev mail list

AFAIK there are no escape sequences, but single bytes (XOFF/XON) in most
terminals mapped to ^s and ^q respectively.

[a]

Aurélien Aptel

unread,
Mar 18, 2010, 11:13:42 AM3/18/10
to dev mail list
VT100 terminals have an autowrap mode set by default that can be
set/unset with the following escape sequences (respectively):

\033[?7h
\033[?7l

From the VT100 user guide [1] :

DECAWM – Autowrap Mode (DEC Private)
This is a private parameter applicable to set mode (SM) and reset mode
(RM) control sequences. The reset state causes any displayable
characters received when the cursor is at the right margin to replace
any previous characters there. The set state causes these characters
to advance to the start of the next line, doing a scroll up if
required and permitted.

(It works in st by the way :)

[1] : http://vt100.net/docs/vt100-ug/chapter3.html#DECAWM

QUINTIN Guillaume

unread,
Mar 18, 2010, 12:04:14 PM3/18/10
to dev mail list
> VT100 terminals have an autowrap mode set by default that can be
> set/unset with the following escape sequences (respectively):
>
> \033[?7h
> \033[?7l
>
I have already tried that but it does not work at least with urxvt, terminal
(xfce terminal), konsole and xterm. If the width of the terminal is 5 then
printf("\033[?7l12345"); will print something like this in the terminal:

|2345 |

instead of

|12345|

Aurélien Aptel

unread,
Mar 18, 2010, 12:52:12 PM3/18/10
to dev mail list
On Thu, Mar 18, 2010 at 5:04 PM, QUINTIN Guillaume
<coinco...@gmail.com> wrote:
> I have already tried that but it does not work at least with urxvt, terminal
> (xfce terminal), konsole and xterm. If the width of the terminal is 5 then
> printf("\033[?7l12345"); will print something like this in the terminal:
>
> |2345 |
>
> instead of
>
> |12345|
>

It works perfectly on my xterm : http://i.imgur.com/fEPvV.png

QUINTIN Guillaume

unread,
Mar 18, 2010, 12:57:40 PM3/18/10
to dev mail list
Yep and in mine too, forget my last mail sorry.
I am really sorry, I just forgot to fflush stdout.

Reply all
Reply to author
Forward
0 new messages