signet.sh/sac/pages/www-linusakesson-net-programming-tty-index-php

984 lines
318 KiB
Plaintext
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><meta name="viewport" content="width=device-width, initial-scale=1" /><link rel="StyleSheet" href="/style4.css" type="text/css" /><link rel="alternate" type="application/rss+xml" title="RSS" href="http://www.linusakesson.net/rssfeed.php" /><link rel="shortcut icon" href="/img/fav2.png" type="image/png" /><link rel="icon" href="/img/fav2.png" type="image/png" /><script type="text/javascript">
<!--
function captchaenter(e) {
var keynum;
if(window.event) { keynum = e.keyCode; } else { keynum = e.which; }
return keynum != 13;
}
function sitecfg() {
document.getElementById("cfgform").submit();
}
//-->
</script><title>The TTY demystified</title></head><body><div class="outer"><div id="leftbar" class="leftbar"><div class="toc0" style="clear: both"><div style="display: block"><a href="/index.php"><img style="display: inline; margin: .2em" src="/img/linus1.png" alt="" />
</a></div><div style="display: block; margin-top: .1em; margin-bottom: .3em"><a href="/index.php" style="font: bold 1em sans-serif; text-decoration: none">linusakesson.net</a></div></div><div class="tocalt" id="tocalt"><a href="#" onclick="document.getElementById('tocdiv').style.display = 'block'; document.getElementById('tocalt').style.display = 'none';" style="font-size: .8em">(show&nbsp;navigation)</a></div><div class="tocdiv" id="tocdiv"><a href="#" onclick="document.getElementById('tocalt').style.display = 'block'; document.getElementById('tocdiv').style.display = 'none';" style="font-size: .8em">(hide&nbsp;navigation)</a><form id="cfgform" method="post" action="/programming/tty/index.php"><div class="confbox"><input type="hidden" name="cmd" value="conf" /><ul class="conf"><li><input onclick="sitecfg()" type="checkbox" name="confswe" /> Swedish content</li></ul><noscript><div><input type="submit" value="Configure site" /></div></noscript></div></form><div class="tocgroup"><form method="get" action="/search.php"><div class="toc2"><h5 style="margin: 8px 0 0 0;">Site search:</h5><input name="q" class="sitesearch" /></div></form><table class="toc"><tr><th class="toc1">Navigation</th></tr><tr><td class="toc2"><a href="/">Home&nbsp;&amp;&nbsp;news</a></td></tr><tr><td class="toc2"><a href="/random.php?anticache=1710424227">Random&nbsp;page</a></td></tr><tr><td class="toc2"><a href="/archive.php">All&nbsp;pages</a></td></tr></table><table class="toc"><tr><th class="toc1">Databases</th></tr><tr><td class="toc2"><a href="/cookies/">Fortune&nbsp;cookies</a></td></tr><tr><td class="toc2"><a href="/themes/">SID&nbsp;themes</a></td></tr></table></div><div class="tocgroup"><table class="toc"><tr><th class="toc1">Page collections</th></tr><tr><td class="toc2"><a href="/blag/index.php">Blag</a></td></tr><tr><td class="toc2"><a href="/music/chipmusic.php">Chip&nbsp;music</a></td></tr><tr><td class="toc2"><a href="/chipophone/pages.php">Chipophone</a></td></tr><tr><td class="toc2"><a href="/games/index.php">Games</a></td></tr><tr><td class="toc2"><a href="/hardware/index.php">Hardware&nbsp;projects</a></td></tr><tr><td class="toc2"><a href="/music/downloads.php">Music&nbsp;downloads</a></td></tr><tr><td class="toc2"><a href="/programming/obfuscation.php">Obfuscated&nbsp;programming</a></td></tr><tr><td class="toc2"><a href="/music/piano.php">Piano&nbsp;music</a></td></tr><tr><td class="toc2"><a href="/programming/index.php">Sane&nbsp;programming</a></td></tr><tr><td class="toc2"><a href="/pages/scene.php">Scene&nbsp;productions</a></td></tr><tr><td class="toc2"><a href="/music/sidstuff/index.php">SID&nbsp;related&nbsp;pages</a></td></tr><tr><td class="toc2"><a href="/software/index.php">Software&nbsp;downloads</a></td></tr><tr><td class="toc2"><a href="/programming/underhanded/index.php">Underhanded&nbsp;code</a></td></tr><tr><td class="toc2"><a href="/pages/video.php">Video&nbsp;clips</a></td></tr></table></div><div class="tocgroup"><table class="toc"><tr><th class="toc1">Featured pages</th></tr><tr><td class="toc2"><a href="/music/15-years-of-scene-spirit/index.php">15&nbsp;Years&nbsp;of&nbsp;Scene&nbsp;Spirit</a></td></tr><tr><td class="toc2"><a href="/dialog/aamachine/index.php">Å-machine</a></td></tr><tr><td class="toc2"><a href="/scene/a-mind-is-born/index.php">A&nbsp;Mind&nbsp;Is&nbsp;Born</a></td></tr><tr><td class="toc2"><a href="/games/autosokoban/index.php">Autosokoban</a></td></tr><tr><td class="toc2"><a href="/software/blackbird/index.php">Blackbird</a></td></tr><tr><td class="toc2"><a href="/hardware/theremin/index.php">C64&nbsp;Theremin</a></td></tr><tr><td class="toc2"><a href="/chipophone/index.php">Chipophone</a></td></tr><tr><td class="toc2"><a href="/music/chopin-e-minor/index.php">Chopin&nbsp;vs&nbsp;Flappy&nbsp;Bird</a></td></tr><tr><td class="toc2"><a href="/music/chuck-rock/index.php">Chuck&nbsp;Rock</a></td></tr><tr><td class="toc2"><a href="/commodordion/index.php">Commodordion</a></td></tr><tr><td class="toc2"><a href="/scene/craft/index.php">Craft</a></td></tr><tr><td class="toc2"><a href="/dialog/craverly/index.php">Craverly&nbsp;Heights&nbsp;in&nbsp;Dialog</a></td></tr><tr><td class="toc2"><a href="/hardware/datassettes/index.php">Datassettes</a></td></tr><tr><td class="toc2"><a href="/hardware/dial-a-sid/index.php">Dial-a-SID</a></td></tr><tr><td class="toc2"><a href="/dialog/index.php">Dialog</a></td></tr><tr><td class="toc2"><a href="/music/elements/index.php">Elements&nbsp;of&nbsp;Chip&nbsp;Music</a></td></tr><tr><td class="toc2"><a href="/games/evolution/c64.php">Evolution&nbsp;of&nbsp;C64&nbsp;games</a></td></tr><tr><td class="toc2"><a href="/programming/underhanded/2015.php">Faking&nbsp;Fissile&nbsp;Material</a></td></tr><tr><td class="toc2"><a href="/music/fratres/index.php">Fratres</a></td></tr><tr><td class="toc2"><a href="/programming/gcr-decoding/index.php">GCR&nbsp;decoding&nbsp;on&nbsp;the&nbsp;fly</a></td></tr><tr><td class="toc2"><a href="/music/glyptodont-live/index.php">Glyptodont&nbsp;Live</a></td></tr><tr><td class="toc2"><a href="/music/guitar-slinger/index.php">Guitar&nbsp;Slinger</a></td></tr><tr><td class="toc2"><a href="/music/sidstuff/hanlonfugue/index.php">Hanlon&nbsp;Fugue</a></td></tr><tr><td class="toc2"><a href="/games/hardsync/index.php">Hardsync</a></td></tr><tr><td class="toc2"><a href="/games/the-impossible-bottle/index.php">Impossible&nbsp;Bottle</a></td></tr><tr><td class="toc2"><a href="/music/in-darkness-hope/index.php">In&nbsp;Darkness&nbsp;Hope</a></td></tr><tr><td class="toc2"><a href="/programming/kernighans-lever/index.php">Kernighan's&nbsp;lever</a></td></tr><tr><td class="toc2"><a href="/music/fjalldata2024/index.php">Live&nbsp;at&nbsp;Fjälldata</a></td></tr><tr><td class="toc2"><a href="/scene/lunatico/index.php">Lunatico</a></td></tr><tr><td class="toc2"><a href="/scene/machine-yearning/index.php">Machine&nbsp;Yearning</a></td></tr><tr><td class="toc2"><a href="/scene/lunatico/misc.php">MISC</a></td></tr><tr><td class="toc2"><a href="/music/monti-on-the-bin/index.php">Monti&nbsp;On&nbsp;The&nbsp;'Bin</a></td></tr><tr><td class="toc2"><a href="/music/for-microcontrollers/index.php">Music&nbsp;For&nbsp;Microcontrollers</a></td></tr><tr><td class="toc2"><a href="/music/o-holy-night/index.php">O&nbsp;Holy&nbsp;Night</a></td></tr><tr><td class="toc2"><a href="/scene/parallelogram/index.php">Parallelogram</a></td></tr><tr><td class="toc2"><a href="/music/partita-prelude/index.php">Partita&nbsp;Prelude</a></td></tr><tr><td class="toc2"><a href="/music/paulimba/index.php">Paulimba</a></td></tr><tr><td class="toc2"><a href="/scene/perpetual-fragility/index.php">Perpetual&nbsp;Fragility</a></td></tr><tr><td class="toc2"><a href="/music/platform-hopping/index.php">Platform&nbsp;Hopping</a></td></tr><tr><td class="toc2"><a href="/programming/poems-for-bugs/index.php">Poems&nbsp;for&nbsp;bugs</a></td></tr><tr><td class="toc2"><a href="/software/qwertuoso/index.php">Qwertuoso</a></td></tr><tr><td class="toc2"><a href="/music/reverberations/index.php">Reverberations</a></td></tr><tr><td class="toc2"><a href="/scene/safevsp/index.php">Safe&nbsp;VSP</a></td></tr><tr><td class="toc2"><a href="/software/sidreloc/index.php">Sidreloc</a></td></tr><tr><td class="toc2"><a href="/sixtyforgan/index.php">Sixtyforgan</a></td></tr><tr><td class="toc2"><a href="/software/spindle/v3.php">Spindle&nbsp;v3</a></td></tr><tr><td class="toc2"><a href="/music/nocturne/index.php">Stein's&nbsp;Nocturne</a></td></tr><tr><td class="toc2"><a href="/blag/210416-streaming.php">Streaming</a></td></tr><tr><td class="toc2"><a href="/hardware/autostart/index.php">Stripboard&nbsp;Cart</a></td></tr><tr><td class="toc2"><a href="/music/three-pc-pieces/index.php">Three&nbsp;PC&nbsp;Pieces</a></td></tr><tr><td class="toc2"><a href="/art/three-petscii-pieces/index.php">Three&nbsp;PETSCII&nbsp;pieces</a></td></tr><tr><td class="toc2"><a href="/programming/tty/index.php">TTY&nbsp;demystified</a></td></tr><tr><td class="toc2"><a href="/music/po-2x/unity.php">Unity</a></td></tr><tr><td class="toc2"><a href="/music/variation18/index.php">Variation&nbsp;18</a></td></tr><tr><td class="toc2"><a href="/music/vivaldi-summer-presto/index.php">Vivaldi&nbsp;Summer&nbsp;Presto</a></td></tr><tr><td class="toc2"><a href="/music/vocalise/index.php">Vocalise</a></td></tr><tr><td class="toc2"><a href="/scene/watchroom.php">Watch&nbsp;Room</a></td></tr><tr><td class="toc2"><a href="/art/nibbles/index.php">We&nbsp;learn&nbsp;the&nbsp;nibbles</a></td></tr><tr><td class="toc2"><a href="/cryptic/2/index.php">Wings&nbsp;I've&nbsp;lost&nbsp;in&nbsp;dreams</a></td></tr><tr><td class="toc2"><a href="/software/zeugma/index.php">Zeugma</a></td></tr></table></div><div class="tocgroup"><table class="toc"><tr><th class="toc1">Fund my projects</th></tr><tr><td class="toc2"><a href="https://patreon.com/linusakesson">Patreon</a></td></tr><tr><td class="toc2"><a href="https://steadyhq.com/linusakesson">Steady</a></td></tr></table><table class="toc"><tr><th class="toc1">Don't miss</th></tr><tr><td class="toc2" style="padding: 0px; text-align: left"><a href="/scene/turbulence/source.php"><img src="/img/pagethumbs/68.png" alt="Page thumbnail" style="border: 1px solid #cccccc; margin: 1em" /></a><br />
<a style="margin-left: 1em" href="/scene/turbulence/source.php">Turbulence source code</a></td></tr></table><table class="toc"><tr><th class="toc1">Forum</th></tr><tr><td class="toc2"><a href="/forum/register.php">Register</a></td></tr><tr><td class="toc2"><a href="/forum/login.php">Log&nbsp;in</a></td></tr><tr><td class="toc2"><a href="/forum/chronological.php">Latest&nbsp;comments</a></td></tr></table><table class="toc"><tr><th class="toc1">Syndication</th></tr><tr><td class="toc2"><a type="application/rss+xml" href="http://www.linusakesson.net/rssfeed.php">RSS feed</a></td></tr></table><table class="toc"><tr><th class="toc1">Feedback</th></tr><tr><td class="toc2"><script type="text/javascript">
<!--
a = "@";a = a + "linusak";a = "linus" + a;a = a + "esson.net";document.write("<a href=\"mailto:");document.write(a);document.write("\">");document.write(a);document.write("</a>");//-->
</script></td></tr></table></div></div></div><div class="maindiv"><div class="maindiv2"><div class="searchable">
<h1>The TTY demystified</h1>
<div style="float: right; margin-left: 1em">
<img src="oldschool.jpg" alt="Teletypes" />
<p class="picnote">Real teletypes in the 1940s.</p>
</div>
<p><span class="blurb">The TTY subsystem is central to the design of Linux, and UNIX in general.
Unfortunately, its importance is often overlooked, and it is difficult to find
good introductory articles about it. I believe that a basic understanding of
TTYs in Linux is essential for the developer and the advanced user.</span></p>
<p>Beware, though: What you are about to see is not particularly elegant. In
fact, the TTY subsystem &mdash; while quite functional from a user's point of
view &mdash; is a twisty little mess of special cases. To understand how this
came to be, we have to go back in time.</p>
<h2>History</h2>
<p>In 1869, the <i>stock ticker</i> was invented. It was an electro-mechanical
machine consisting of a typewriter, a long pair of wires and a ticker tape
printer, and its purpose was to distribute stock prices over long distances in
realtime. This concept gradually evolved into the faster, ASCII-based
<i>teletype</i>. Teletypes were once connected across the world in a large
network, called <i>Telex</i>, which was used for transferring commercial
telegrams, but the teletypes weren't connected to any computers yet.</p>
<p>Meanwhile, however, the computers &mdash; still quite large and
primitive, but able to multitask &mdash; were becoming powerful enough to be
able to interact with users in realtime. When the command line eventually
replaced the old batch processing model, teletypes were used as input and
output devices, because they were readily available on the market.</p>
<p>There was a plethora of teletype models around, all slightly different, so
some kind of software compatibility layer was called for. In the UNIX world,
the approach was to let the operating system kernel handle all the low-level
details, such as word length, baud rate, flow control, parity, control codes
for rudimentary line editing and so on. Fancy cursor movements, colour output
and other advanced features made possible in the late 1970s by solid state
<i>video terminals</i> such as the VT-100, were left to the applications.</p>
<p>In present time, we find ourselves in a world where physical teletypes and
video terminals are practically extinct. Unless you visit a museum or a
hardware enthusiast, all the TTYs you're likely to see will be emulated video
terminals &mdash; software simulations of the real thing. But as we shall
see, the legacy from the old cast-iron beasts is still lurking beneath the
surface.</p>
<h2>The use cases</h2>
<img src="case1.png" alt="Diagram" />
<p>A user types at a terminal (a physical teletype). This terminal is connected
through a pair of wires to a <i>UART</i> (Universal Asynchronous Receiver and
Transmitter) on the computer. The operating system contains a <i>UART driver</i> which
manages the physical transmission of bytes, including parity checks and flow
control. In a naïve system, the UART driver would then deliver the incoming
bytes directly to some application process. But such an approach would lack the
following essential features:</p>
<p><b>Line editing.</b> Most users make mistakes while typing, so a backspace
key is often useful. This could of course be implemented by the applications
themselves, but in accordance with the UNIX design philosophy, applications
should be kept as simple as possible. So as a convenience, the operating system
provides an editing buffer and some rudimentary editing commands (backspace,
erase word, clear line, reprint), which are enabled by default inside the
<i>line discipline</i>. Advanced applications may disable these features by
putting the line discipline in <i>raw</i> mode instead of the default
<i>cooked</i> (or <i>canonical</i>) mode. Most interactive applications
(editors, mail user agents, shells, all programs relying on <tt>curses</tt> or
<tt>readline</tt>) run in raw mode, and handle all the line editing commands
themselves. The line discipline also contains options for character echoing and
automatic conversion between carriage returns and linefeeds. Think of it as a
primitive kernel-level <tt>sed(1)</tt>, if you like.</p>
<p>Incidentally, the kernel provides several different line disciplines. Only
one of them is attached to a given serial device at a time. The default
discipline, which provides line editing, is called <tt>N_TTY</tt>
(<tt>drivers/char/n_tty.c</tt>, if you're feeling adventurous). Other
disciplines are used for other purposes, such as managing packet switched data
(ppp, IrDA, serial mice), but that is outside the scope of this article.</p>
<p><b>Session management.</b> The user probably wants to run several programs
simultaneously, and interact with them one at a time. If a program goes into an
endless loop, the user may want to kill it or suspend it. Programs that are
started in the background should be able to execute until they try to write to
the terminal, at which point they should be suspended. Likewise, user input
should be directed to the foreground program only. The operating system
implements these features in the <i>TTY driver</i>
(<tt>drivers/char/tty_io.c</tt>).</p>
<p>An operating system process is "alive" (has an <i>execution context</i>),
which means that it can perform actions. The TTY driver is not alive; in object oriented
terminology, the TTY driver is a passive object. It has some data fields and some
methods, but the only way it can actually do something is when one of its
methods gets called from the context of a process or a kernel interrupt
handler. The line discipline is likewise a passive entity.</p>
<p>Together, a particular triplet of UART driver, line discipline instance and
TTY driver may be referred to as a <i>TTY device</i>, or sometimes just TTY. A
user process can affect the behaviour of any TTY device by manipulating the
corresponding device file under <tt>/dev</tt>. Write permissions to the device
file are required, so when a user logs in on a particular TTY, that user must
become the owner of the device file. This is traditionally done by the
<tt>login(1)</tt> program, which runs with root privileges.</p>
<p>The physical line in the previous diagram could of course be a long-distance
phone line:</p>
<img src="case2.png" alt="Diagram" />
<p>This does not change much, except that the system now has to handle a modem
hangup situation as well.</p>
<p>Let's move on to a typical desktop system. This is how the Linux console
works:</p>
<img src="case3.png" alt="Diagram" />
<p>The TTY driver and line discipline behave just like in the previous
examples, but there is no UART or physical terminal involved anymore. Instead,
a video terminal (a complex state machine including a <i>frame buffer</i> of
characters and graphical character attributes) is emulated in software, and
rendered to a VGA display.</p>
<p>The console subsystem is somewhat rigid. Things get more flexible (and
abstract) if we move the terminal emulation into userland. This is how
<tt>xterm(1)</tt> and its clones work:</p>
<img src="case4.png" alt="Diagram" />
<p>To facilitate moving the terminal emulation into userland, while still
keeping the TTY subsystem (session management and line discipline) intact, the
<i>pseudo terminal</i> or <i>pty</i> was invented. And as you may have guessed,
things get even more complicated when you start running pseudo terminals
inside pseudo terminals, à la <tt>screen(1)</tt> or <tt>ssh(1)</tt>.</p>
<p>Now let's take a step back and see how all of this fits into the
process model.</p>
<h2>Processes</h2>
<p>A Linux process can be in one of the following states:</p>
<img src="linuxprocess.png" alt="Process states" />
<table>
<tr><td>R</td><td>Running or runnable (on run queue)</td></tr>
<tr><td>D</td><td>Uninterruptible sleep (waiting for some event)</td></tr>
<tr><td>S</td><td>Interruptible sleep (waiting for some event or signal)</td></tr>
<tr><td>T</td><td>Stopped, either by a job control signal or because it is being traced by a debugger.</td></tr>
<tr><td>Z</td><td>Zombie process, terminated but not yet reaped by its parent.</td></tr>
</table>
<p>By running <tt>ps l</tt>, you can see which processes are running, and which are
sleeping. If a process is sleeping, the <tt>WCHAN</tt> column ("wait channel", the name
of the wait queue) will tell you what kernel event the process is waiting for.</p>
<div class="otherbg" style="font-size: .6em">
<pre>
$ ps l
F UID PID PPID PRI NI VSZ RSS WCHAN STAT TTY TIME COMMAND
0 500 5942 5928 15 0 12916 1460 wait Ss pts/14 0:00 -/bin/bash
0 500 12235 5942 15 0 21004 3572 wait S+ pts/14 0:01 vim index.php
0 500 12580 12235 15 0 8080 1440 wait S+ pts/14 0:00 /bin/bash -c (ps l) >/tmp/v727757/1 2>&amp;1
0 500 12581 12580 15 0 4412 824 - R+ pts/14 0:00 ps l
</pre>
</div>
<p>The "<tt>wait</tt>" wait queue corresponds to the <tt>wait(2)</tt> syscall,
so these processes will be moved to the running state whenever there's a state change in one of their
child processes. There are two sleeping states: Interruptible
sleep and uninterruptible sleep. Interruptible sleep (the most common case)
means that while the process is part of a wait queue, it may actually also be
moved to the running state when a signal is sent to it. If you look inside the
kernel source code, you will find that any kernel code which is waiting for an
event must check if a signal is pending after schedule() returns, and abort the
syscall in that case.</p>
<p>
In the <tt>ps</tt> listing above, the <tt>STAT</tt> column displays the current state of each
process. The same column may also contain one or more attributes, or flags:
</p>
<table>
<tr><td>s</td><td>This process is a session leader.</td></tr>
<tr><td>+</td><td>This process is part of a foreground process group.</td></tr>
</table>
<p>These attributes are used for job control.</p>
<h2>Jobs and sessions</h2>
<p>Job control is what happens when you press <tt>^Z</tt> to suspend a program,
or when you start a program in the background using <tt>&amp;</tt>. A job is
the same as a process group. Internal shell commands like <tt>jobs</tt>,
<tt>fg</tt> and <tt>bg</tt> can be used to manipulate the existing jobs within
a <i>session</i>. Each session is managed by a <i>session leader</i>, the
shell, which is cooperating tightly with the kernel using a complex protocol of
signals and system calls.</p>
<p>The following example illustrates the relationship between processes, jobs
and sessions:</p>
<h3 style="margin-top: 1em; margin-bottom: 1em">The following shell interactions...</h3>
<img src="exampleterm.png" alt="Screenshot" style="border: 1px solid #444444; margin-left: 16px" />
<h3 style="margin-top: 1em; margin-bottom: 0.3em">...correspond to these processes...</h3>
<img src="examplediagram.png" alt="Table" />
<h3 style="margin-top: 0em; margin-bottom: 1em">...and these kernel structures.</h3>
<ul>
<li>TTY Driver (<tt>/dev/pts/0</tt>).
<pre>
Size: 45x13
Controlling process group: (101)
Foreground process group: (103)
UART configuration (ignored, since this is an xterm):
Baud rate, parity, word length and much more.
Line discipline configuration:
cooked/raw mode, linefeed correction,
meaning of interrupt characters etc.
Line discipline state:
edit buffer (currently empty),
cursor position within buffer etc.
</pre>
</li>
<li>pipe0
<pre>
Readable end (connected to PID 104 as file descriptor 0)
Writable end (connected to PID 103 as file descriptor 1)
Buffer
</pre>
</li>
</ul>
<p>The basic idea is that every pipeline is a job, because every process in a
pipeline should be manipulated (stopped, resumed, killed) simultaneously.
That's why <tt>kill(2)</tt> allows you to send signals to entire process
groups. By default, <tt>fork(2)</tt> places a newly created child process in
the same process group as its parent, so that e.g. a <tt>^C</tt> from the
keyboard will affect both parent and child. But the shell, as part of its
session leader duties, creates a new process group every time it
launches a pipeline.</p>
<p>The TTY driver keeps track of the foreground process group id, but only in a
passive way. The session leader has to update this information explicitly when
necessary. Similarly, the TTY driver keeps track of the size of the connected
terminal, but this information has to be updated explicitly, by the terminal
emulator or even by the user.</p>
<p>As you can see in the diagram above, several processes have
<tt>/dev/pts/0</tt> attached to their standard input. But only the foreground
job (the <tt>ls&nbsp;|&nbsp;sort</tt> pipeline) will receive input from the
TTY. Likewise, only the foreground job will be allowed to write to the TTY
device (in the default configuration). If the cat process were to attempt to
write to the TTY, the kernel would suspend it using a signal.</p>
<h2>Signal madness</h2>
<p>Now let's take a closer look at how the TTY drivers, the line disciplines
and the UART drivers in the kernel communicate with the userland processes.</p>
<p>UNIX files, including the TTY device file, can of course be read from and
written to, and further manipulated by means of the magic <tt>ioctl(2)</tt> call (the Swiss
army-knife of UNIX) for which lots of TTY related operations have been defined.
Still, <tt>ioctl</tt> requests have to be initiated from processes, so they can't be
used when the kernel needs to communicate <i>asynchronously</i> with an
application.</p>
<p>In <i>The Hitchhiker's Guide to the Galaxy</i>, Douglas Adams mentions an
extremely dull planet, inhabited by a bunch of depressed humans and a certain breed
of animals with sharp teeth which communicate with the humans by biting them
very hard in the thighs. This is strikingly similar to UNIX, in which the kernel
communicates with processes by sending paralyzing or deadly signals to them.
Processes may intercept some of the signals, and try to adapt to the situation,
but most of them don't.</p>
<p>So a signal is a crude mechanism that allows the kernel to communicate
asynchronously with a process. Signals in UNIX aren't clean or general; rather,
each signal is unique, and must be studied individually.</p>
<p>You can use the command <tt>kill -l</tt> to see which signals your system implements.
This is what it may look like:</p>
<pre>
$ kill -l
1) SIGHUP 2) SIGINT 3) SIGQUIT 4) SIGILL
5) SIGTRAP 6) SIGABRT 7) SIGBUS 8) SIGFPE
9) SIGKILL 10) SIGUSR1 11) SIGSEGV 12) SIGUSR2
13) SIGPIPE 14) SIGALRM 15) SIGTERM 16) SIGSTKFLT
17) SIGCHLD 18) SIGCONT 19) SIGSTOP 20) SIGTSTP
21) SIGTTIN 22) SIGTTOU 23) SIGURG 24) SIGXCPU
25) SIGXFSZ 26) SIGVTALRM 27) SIGPROF 28) SIGWINCH
29) SIGIO 30) SIGPWR 31) SIGSYS 34) SIGRTMIN
35) SIGRTMIN+1 36) SIGRTMIN+2 37) SIGRTMIN+3 38) SIGRTMIN+4
39) SIGRTMIN+5 40) SIGRTMIN+6 41) SIGRTMIN+7 42) SIGRTMIN+8
43) SIGRTMIN+9 44) SIGRTMIN+10 45) SIGRTMIN+11 46) SIGRTMIN+12
47) SIGRTMIN+13 48) SIGRTMIN+14 49) SIGRTMIN+15 50) SIGRTMAX-14
51) SIGRTMAX-13 52) SIGRTMAX-12 53) SIGRTMAX-11 54) SIGRTMAX-10
55) SIGRTMAX-9 56) SIGRTMAX-8 57) SIGRTMAX-7 58) SIGRTMAX-6
59) SIGRTMAX-5 60) SIGRTMAX-4 61) SIGRTMAX-3 62) SIGRTMAX-2
63) SIGRTMAX-1 64) SIGRTMAX
</pre>
<p>As you can see, signals are numbered starting with 1. However, when they are
used in bitmasks (e.g. in the output of <tt>ps s</tt>), the least significant bit
corresponds to signal 1.</p>
<p>This article will focus on the following signals: <tt>SIGHUP</tt>,
<tt>SIGINT</tt>, <tt>SIGQUIT</tt>, <tt>SIGPIPE</tt>, <tt>SIGCHLD</tt>,
<tt>SIGSTOP</tt>, <tt>SIGCONT</tt>, <tt>SIGTSTP</tt>, <tt>SIGTTIN</tt>,
<tt>SIGTTOU</tt> and <tt>SIGWINCH</tt>.</p>
<div class="ttysignal">
<h3>SIGHUP</h3>
<ul><li>Default action: <b>Terminate</b></li>
<li>Possible actions: Terminate, Ignore, Function call</li></ul>
<p><tt>SIGHUP</tt> is sent by the UART driver to the entire session when a hangup
condition has been detected. Normally, this will kill all the processes. Some
programs, such as <tt>nohup(1)</tt> and <tt>screen(1)</tt>, detach
from their session (and TTY), so that their child processes won't notice a
hangup.</p>
</div>
<div class="ttysignal">
<h3>SIGINT</h3>
<ul><li>Default action: <b>Terminate</b></li>
<li>Possible actions: Terminate, Ignore, Function call</li></ul>
<p><tt>SIGINT</tt> is sent by the TTY driver to the current foreground job when the
<i>interactive attention</i> character (typically <tt>^C</tt>, which has ASCII
code&nbsp;3) appears in the input stream, unless this behaviour has been turned
off. Anybody with access permissions to the TTY device can change the
interactive attention character and toggle this feature; additionally, the
session manager keeps track of the TTY configuration of each job, and updates
the TTY whenever there is a job switch.</p>
</div>
<div class="ttysignal">
<h3>SIGQUIT</h3>
<ul><li>Default action: <b>Core dump</b></li>
<li>Possible actions: Core dump, Ignore, Function call</li></ul>
<p><tt>SIGQUIT</tt> works just like <tt>SIGINT</tt>, but the quit character is typically
<tt>^\</tt> and the default action is different.</p>
</div>
<div class="ttysignal">
<h3>SIGPIPE</h3>
<ul><li>Default action: <b>Terminate</b></li>
<li>Possible actions: Terminate, Ignore, Function call</li></ul>
<p>The kernel sends <tt>SIGPIPE</tt> to any process which tries to write to a pipe with
no readers. This is useful, because otherwise jobs like
<tt>yes&nbsp;|&nbsp;head</tt> would never terminate.</p>
</div>
<div class="ttysignal">
<h3>SIGCHLD</h3>
<ul><li>Default action: <b>Ignore</b></li>
<li>Possible actions: Ignore, Function call</li></ul>
<p>When a process dies or changes state (stop/continue), the kernel sends a
<tt>SIGCHLD</tt> to its parent process. The <tt>SIGCHLD</tt> signal carries additional
information, namely the process id, the user id, the exit status (or
termination signal) of the terminated process and some execution time
statistics. The session leader (shell) keeps track of its jobs using this
signal.</p>
</div>
<div class="ttysignal">
<h3>SIGSTOP</h3>
<ul><li>Default action: <b>Suspend</b></li>
<li>Possible actions: Suspend</li></ul>
<p>This signal will unconditionally suspend the recipient, i.e. its signal
action can't be reconfigured. Please note, however, that <tt>SIGSTOP</tt>
isn't sent by the kernel during job control. Instead, <tt>^Z</tt> typically
triggers a <tt>SIGTSTP</tt>, which can be intercepted by the application. The
application may then e.g. move the cursor to the bottom of the screen or
otherwise put the terminal in a known state, and subsequently put itself to sleep using <tt>SIGSTOP</tt>.</p>
</div>
<div class="ttysignal">
<h3>SIGCONT</h3>
<ul><li>Default action: <b>Wake up</b></li>
<li>Possible actions: Wake up, Wake up + Function call</li></ul>
<p><tt>SIGCONT</tt> will un-suspend a stopped process. It is sent explicitly by the
shell when the user invokes the <tt>fg</tt> command. Since <tt>SIGSTOP</tt> can't be
intercepted by an application, an unexpected <tt>SIGCONT</tt> signal might indicate that
the process was suspended some time ago, and then un-suspended.</p>
</div>
<div class="ttysignal">
<h3>SIGTSTP</h3>
<ul><li>Default action: <b>Suspend</b></li>
<li>Possible actions: Suspend, Ignore, Function call</li></ul>
<p><tt>SIGTSTP</tt> works just like <tt>SIGINT</tt> and <tt>SIGQUIT</tt>, but the magic character is
typically <tt>^Z</tt> and the default action is to suspend the process.</p>
</div>
<div class="ttysignal">
<h3>SIGTTIN</h3>
<ul><li>Default action: <b>Suspend</b></li>
<li>Possible actions: Suspend, Ignore, Function call</li></ul>
<p>If a process within a background job tries to read from a TTY device, the
TTY sends a <tt>SIGTTIN</tt> signal to the entire job. This will normally suspend the
job.</p>
</div>
<div class="ttysignal">
<h3>SIGTTOU</h3>
<ul><li>Default action: <b>Suspend</b></li>
<li>Possible actions: Suspend, Ignore, Function call</li></ul>
<p>If a process within a background job tries to write to a TTY device, the TTY
sends a <tt>SIGTTOU</tt> signal to the entire job. This will normally suspend the job.
It is possible to turn off this feature on a per-TTY basis.</p>
</div>
<div class="ttysignal">
<h3>SIGWINCH</h3>
<ul><li>Default action: <b>Ignore</b></li>
<li>Possible actions: Ignore, Function call</li></ul>
<p>As mentioned, the TTY device keeps track of the terminal size, but this
information needs to be updated manually. Whenever that happens, the TTY device
sends <tt>SIGWINCH</tt> to the foreground job. Well-behaving interactive applications,
such as editors, react upon this, fetch the new terminal size from the TTY
device and redraw themselves accordingly.</p>
</div>
<h2 style="clear: left; padding-top: 1em;">An example</h2>
<p>Suppose that you are editing a file in your (terminal based) editor of
choice. The cursor is somewhere in the middle of the screen, and the editor is
busy executing some processor intensive task, such as a search and replace
operation on a large file. Now you press <tt>^Z</tt>. Since the line
discipline has been configured to intercept this character (<tt>^Z</tt> is a
single byte, with ASCII code 26), you don't have to wait for the editor to
complete its task and start reading from the TTY device. Instead, the line discipline
subsystem instantly sends <tt>SIGTSTP</tt> to the foreground process group. This process
group contains the editor, as well as any child processes created by it.</p>
<p>The editor has installed a signal handler for <tt>SIGTSTP</tt>, so the kernel diverts
the process into executing the signal handler code. This code moves the cursor
to the last line on the screen, by writing the corresponding control sequences
to the TTY device. Since the editor is still in the foreground, the control
sequences are transmitted as requested. But then the editor sends a <tt>SIGSTOP</tt> to
its own process group.</p>
<p>The editor has now been stopped. This fact is reported to the session leader
using a <tt>SIGCHLD</tt> signal, which includes the id of the suspended
process. When all processes in the foreground job have been suspended, the
session leader reads the current configuration from the TTY device, and stores
it for later retrieval. The session leader goes on to install itself as the
current foreground process group for the TTY using an <tt>ioctl</tt> call.
Then, it prints something like "[1]+ Stopped" to inform the user that a job was
just suspended.</p>
<p>At this point, <tt>ps(1)</tt> will tell you that the editor process is in
the stopped state ("<tt>T</tt>"). If we try to wake it up, either by using the <tt>bg</tt>
built-in shell command, or by using <tt>kill(1)</tt> to send <tt>SIGCONT</tt> to the
process(es), the editor will start executing its <tt>SIGCONT</tt> signal handler. This
signal handler will probably attempt to redraw the editor GUI by writing to the
TTY device. But since the editor is now a background job, the TTY device will
not allow it. Instead, the TTY will send <tt>SIGTTOU</tt> to the editor, stopping it
again. This fact will be communicated to the session leader using <tt>SIGCHLD</tt>, and
the shell will once again write "[1]+ Stopped" to the terminal.</p>
<p>When we type <tt>fg</tt>, however, the shell first restores the line
discipline configuration that was saved earlier. It informs the TTY driver that
the editor job should be treated as the foreground job from now on. And
finally, it sends a <tt>SIGCONT</tt> signal to the process group. The editor process
attempts to redraw its GUI, and this time it will not be interrupted by <tt>SIGTTOU</tt>
since it is now a part of the foreground job.</p>
<h2>Flow control and blocking I/O</h2>
<div class="inlineleft" style="width: 300px" ><a href="/pix/data/061001-1/dsc00043.jpg"><img src="/pix/data/061001-1/300/300/dsc00043.jpg" alt="" /></a></div>
<p>Run <tt>yes</tt> in an <tt>xterm</tt>, and you will see a lot of
"<tt>y</tt>" lines swooshing past your eyes. Naturally, the <tt>yes</tt>
process is able to generate "<tt>y</tt>" lines much faster than the
<tt>xterm</tt> application is able to parse them, update its frame buffer,
communicate with the X server in order to scroll the window and so on. How is
it possible for these programs to cooperate?</p>
<p>The answer lies in <i>blocking I/O</i>. The pseudo terminal can only keep a
certain amount of data inside its kernel buffer, and when that buffer is full
and <tt>yes</tt> tries to call <tt>write(2)</tt>, then <tt>write(2)</tt> will
<i>block</i>, moving the <tt>yes</tt> process into the interruptible sleep
state where it remains until the <tt>xterm</tt> process has had a chance to
read off some of the buffered bytes.</p>
<p>The same thing happens if the TTY is connected to a serial port.
<tt>yes</tt> would be able to transmit data at a much higher rate than, say,
9600&nbsp;baud, but if the serial port is limited to that speed, the kernel
buffer soon fills up and any subsequent <tt>write(2)</tt> calls block the
process (or fail with the error code <tt>EAGAIN</tt> if the process has
requested non-blocking I/O).</p>
<p>What if I told you, that it is possible to explicitly put the TTY in a
blocking state even though there is space left in the kernel buffer? That until
further notice, every process trying to <tt>write(2)</tt> to the TTY
automatically blocks. What would be the use of such a feature?</p>
<p>Suppose we're talking to some old VT-100 hardware at 9600&nbsp;baud. We
just sent a complex control sequence asking the terminal to scroll the display.
At this point, the terminal gets so bogged down with the scrolling operation,
that it's unable to receive new data at the full rate of 9600&nbsp;baud. Well,
physically, the terminal UART still runs at 9600&nbsp;baud, but there won't be enough
buffer space in the terminal to keep a backlog of received characters. This is
when it would be a good time to put the TTY in a blocking state. But how do we
do that from the terminal?</p>
<p>We have already seen that a TTY device may be configured to give certain
data bytes a special treatment. In the default configuration, for instance, a
received <tt>^C</tt> byte won't be handed off to the application through
<tt>read(2)</tt>, but will instead cause a <tt>SIGINT</tt> to be delivered to
the foreground job. In a similar way, it is possible to configure the TTY to
react on a <i>stop flow</i> byte and a <i>start flow</i> byte. These are
typically <tt>^S</tt> (ASCII code 19) and <tt>^Q</tt> (ASCII code 17)
respectively. Old hardware terminals transmit these bytes
automatically, and expect the operating system to regulate its flow of data
accordingly. This is called flow control, and it's the reason why your
<tt>xterm</tt> sometimes appears to lock up when you accidentally press
<tt>^S</tt>.</p>
<p>There's an important difference here: Writing to a TTY which is stopped due
to flow control, or due to lack of kernel buffer space, will <i>block</i> your
process, whereas writing to a TTY from a background job will cause a
<tt>SIGTTOU</tt> to suspend the entire process group. I don't know why the
designers of UNIX had to go all the way to invent <tt>SIGTTOU</tt> and
<tt>SIGTTIN</tt> instead of relying on blocking I/O, but my best guess is that
the TTY driver, being in charge of job control, was designed to monitor and
manipulate whole jobs; never the individual processes within them.</p>
<h2>Configuring the TTY device</h2>
<div style="float: right; margin-left: 1em">
<img src="cockpit.jpg" alt="Control panel" />
</div>
<p>To find out what the controlling TTY for your shell is called, you could
refer to the <tt>ps l</tt> listing as described earlier, or you could simply
run the <tt>tty(1)</tt> command.</p>
<p>A process may read or modify the configuration of an open TTY device
using <tt>ioctl(2)</tt>. The API is described in <tt>tty_ioctl(4)</tt>. Since
it's part of the binary interface between Linux applications and the kernel,
it will remain stable across Linux versions. However, the interface is
non-portable, and applications should rather use the POSIX wrappers described
in the <tt>termios(3)</tt> man page.</p>
<p>I won't go into the details of the <tt>termios(3)</tt> interface, but if
you're writing a C program and would like to intercept <tt>^C</tt> before it
becomes a <tt>SIGINT</tt>, disable line editing or character echoing, change
the baud rate of a serial port, turn off flow control etc. then you will find
what you need in the aforementioned man page.</p>
<p>There is also a command line tool, called <tt>stty(1)</tt>, to manipulate
TTY&nbsp;devices. It uses the <tt>termios(3)</tt>&nbsp;API.</p>
<p>Let's try it!</p>
<tt style="font-size: 10px">
$ stty -a<br />
speed 38400 baud; rows 73; columns 238; line = 0;<br />
intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = &lt;undef&gt;; eol2 = &lt;undef&gt;; swtch = &lt;undef&gt;; start = ^Q; stop = ^S; susp = ^Z; rprnt = ^R; werase = ^W; lnext = ^V; flush = ^O; min = 1; time = 0;<br />
-parenb -parodd cs8 -hupcl -cstopb cread -clocal -crtscts<br />
-ignbrk brkint ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl ixon -ixoff -iuclc -ixany imaxbel -iutf8<br />
opost -olcuc -ocrnl onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0<br />
isig icanon iexten echo echoe echok -echonl -noflsh -xcase -tostop -echoprt echoctl echoke<br />
</tt>
<p>The <tt>-a</tt> flag tells stty to display <b>all</b> settings. By default,
it will look at the TTY device attached to your shell, but you can specify
another device with <tt>-F</tt>.</p>
<p>Some of these settings refer to UART parameters, some affect the line
discipline and some are for job control. <i>All mixed up in a bucket for
monsieur.</i> Let's have a look at the first line:</p>
<table class="sttytable">
<tr><td>speed</td><td>UART</td><td>The baud rate. Ignored for pseudo terminals.</td></tr>
<tr><td>rows,&nbsp;columns</td><td>TTY driver</td><td>Somebody's idea of the size, in characters, of the terminal attached to this TTY device. Basically, it's just a pair of variables within kernel space, that you may freely set and get. Setting them will cause the TTY driver to dispatch a <tt>SIGWINCH</tt> to the foreground job.</td></tr>
<tr><td>line</td><td>Line&nbsp;discipline</td><td>The line discipline attached to the TTY device. 0 is <tt>N_TTY</tt>. All valid numbers are listed in <tt>/proc/tty/ldiscs</tt>. Unlisted numbers appear to be aliases for <tt>N_TTY</tt>, but don't rely on it.</td></tr>
</table>
<p>Try the following: Start an <tt>xterm</tt>. Make a note of its TTY device
(as reported by <tt>tty</tt>) and its size (as reported by <tt>stty -a</tt>).
Start <tt>vim</tt> (or some other full-screen terminal application) in the
<tt>xterm</tt>. The editor queries the TTY device for the current terminal size
in order to fill the entire window. Now, from a different shell window, type:</p>
<pre>stty -F <i>X</i> rows <i>Y</i></pre>
<p>where <i>X</i> is the TTY device, and
<i>Y</i> is half the terminal height. This will update the TTY data structure
in kernel memory, and send a <tt>SIGWINCH</tt> to the editor, which will
promptly redraw itself using only the upper half of the available window
area.</p>
<p>The second line of <tt>stty -a</tt> output lists all the special characters.
Start a new <tt>xterm</tt> and try this:</p>
<pre>stty intr o</pre>
<p>Now "<tt>o</tt>", rather than <tt>^C</tt>, will send a <tt>SIGINT</tt> to
the foreground job. Try starting something, such as <tt>cat</tt>, and verify
that you can't kill it using <tt>^C</tt>. Then, try typing "<tt>hello</tt>"
into it.</p>
<p>Occasionally, you may come across a UNIX system where the backspace key
doesn't work. This happens when the terminal emulator transmits a backspace
code (either ASCII&nbsp;8 or ASCII&nbsp;127) which doesn't match the <tt>erase</tt>
setting in the TTY device. To remedy the problem, one usually types <tt>stty
erase ^H</tt> (for ASCII&nbsp;8) or <tt>stty erase ^?</tt> (for ASCII&nbsp;127). But
please remember that many terminal applications use <tt>readline</tt>, which
puts the line discipline in raw mode. Those applications aren't affected.</p>
<p>Finally, <tt>stty -a</tt> lists a bunch of switches. As expected, they are
listed in no particular order. Some of them are UART-related, some affect the
line discipline behaviour, some are for flow control and some are for job
control. A dash (<tt>-</tt>) indicates that the switch is off; otherwise it is
on. All of the switches are explained in the <tt>stty(1)</tt> man page, so
I'll just briefly mention a few:</p>
<p><b><tt>icanon</tt></b> toggles the canonical (line-based) mode. Try this in a new <tt>xterm</tt>:</p>
<pre>stty -icanon; cat</pre>
<p>Note how all the line editing characters, such as backspace and <tt>^U</tt>,
have stopped working. Also note that <tt>cat</tt> is receiving (and
consequently outputting) one character at a time, rather than one line at a
time.</p>
<p><b><tt>echo</tt></b> enables character echoing, and is on by default.
Re-enable canonical mode (<tt>stty icanon</tt>), and then try:</p>
<pre>stty -echo; cat</pre>
<p>As you type, your terminal emulator transmits information to the kernel.
Usually, the kernel echoes the same information back to the terminal emulator,
allowing you to see what you type. Without character echoing, you can't see
what you type, but we're in cooked mode so the line editing facilities are
still working. Once you press enter, the line discipline will transmit the edit
buffer to <tt>cat</tt>, which will reveal what your wrote.</p>
<p><b><tt>tostop</tt></b> controls whether background jobs are allowed to write to the terminal. First try this:</p>
<pre>stty tostop; (sleep 5; echo hello, world) &amp;</pre>
<p>The <tt>&amp;</tt> causes the command to run as a background job. After five
seconds, the job will attempt to write to the TTY. The TTY driver will suspend
it using <tt>SIGTTOU</tt>, and your shell will probably report this fact,
either immediately, or when it's about to issue a new prompt to you. Now kill
the background job, and try the following instead:</p>
<pre>stty -tostop; (sleep 5; echo hello, world) &amp;</pre>
<p>You will get your prompt back, but after five seconds, the background job
transmits <tt>hello, world</tt> to the terminal, in the middle of whatever you
were typing.</p>
<p>Finally, <tt>stty sane</tt> will restore your TTY device configuration to
something reasonable.</p>
<h2>Conclusion</h2>
<p>I hope this article has provided you with enough information to get to terms
with TTY drivers and line disciplines, and how they are related to terminals, line
editing and job control. Further details can be found in the various man pages
I've mentioned, as well as in the glibc manual (<tt>info libc</tt>, "Job
Control").</p>
<p>Finally, while I don't have enough time to answer all the questions I get, I
do welcome feedback on this and other pages on the site. Thanks for
reading!</p>
<div style="clear: both"><p class="edited">Posted Friday 25-Jul-2008 17:46</p></div>
<div style="width: 100%; word-wrap: break-word; clear: both">
<h3 style="padding-top: 1em">Discuss this page</h3><p class="disclaimer">Disclaimer: I am not responsible for what people (other than myself) write in the forums. Please report any abuse, such as insults, slander, spam and illegal material, and I will take appropriate actions. Don't feed the trolls.</p><p class="disclaimer">Jag tar inget ansvar för det som skrivs i forumet, förutom mina egna inlägg. Vänligen rapportera alla inlägg som bryter mot reglerna, så ska jag se vad jag kan göra. Som regelbrott räknas till exempel förolämpningar, förtal, spam och olagligt material. Mata inte trålarna.</p><div class="forum0"><div class="forum1">Anonymous<br />Sun 24-Aug-2008 21:36</div><div class="forum2">Very good and informative article for a complex topic<br />- the tty system really gets demystified here.<br /><br />Only a small correction:<br />Your statement &quot;icanon switches between raw and cooked mode&quot; is not completely true.<br /><br />'stty -icanon' still interprets control characters such as Ctrl-C whereas 'stty raw' disables even this and is the real raw mode.<br /><br />Greetings,<br />-Andreas.</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="202" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="202" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1"><b>lft</b><br />Linus Åkesson<br />Fri 29-Aug-2008 16:42</div><div class="forum2"><div class="forumquote">Very good and informative article for a complex topic<br />- the tty system really gets demystified here.<br /><br />Only a small correction:<br />Your statement &quot;icanon switches between raw and cooked mode&quot; is not completely true.<br /><br />'stty -icanon' still interprets control characters such as Ctrl-C whereas 'stty raw' disables even this and is the real raw mode.<br /></div><br />Thanks!<br /><br />Yes, you're quite right. I've fixed it.</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="206" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="206" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Wed 26-Nov-2008 07:13</div><div class="forum2">I have been trying to chew through documents in every unix book possible to explain how the TTY system really works. Your article has been more informative than all of these books. Without a programmers knowledge of how a unix kernel works, it's quite difficult for a System Administrator to understand concepts that are so crucial to their jobs. Thank you for your writing such a great article. Your help is truly appreciated.</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="258" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="258" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Wed 10-Dec-2008 12:27</div><div class="forum2">I really admire you!! I'm not use to post, but this article was by far the best I ever read about tty, i read many articles and even books but nothing so clear like this. <br />Keep doing things like this please...<br /><br />Excelente!<br />Muchas Gracias<br />Fede Tula</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="259" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="259" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Sat 20-Dec-2008 05:20</div><div class="forum2">Good article. A few years ago, after some experimentation, I wrote up some TTY stuff for myself, because I couldn't find any good documentation. For example, I never understood why process group leaders (and consequently also session leaders) are prevented from calling setsid(2). (See the manual for what setsid(2) does.) I think I can explain it now.<br /><br />The process P is a pg leader if P.PID = P.PGID. In the example of the article, &quot;Job&quot; means process group, and ls (103) is a process group leader:<br /><br />ls.PID = 103<br />ls.PGID = 103<br />ls.SID = 101<br />ls.CTTY = /dev/pts/0<br /><br />Suppose we allow ls to call setsid(2). This would have the following consequences:<br /><br />ls.PID = 103 # unchanged<br />ls.PGID = 103 # set to ls.PID, but in fact this is no change!<br />ls.SID = 103 # set to ls.PID<br />ls.CTTY = &lt;none&gt;<br /><br />Now ls is session leader (ls.SID = ls.PID), and ls is process group leader (ls.PGID = ls.PID).<br /><br />At this point, however, sort (104) would belong to a process group (103) whose leader's (ls's) SID (103) doesn't match sort's SID (101)!<br /><br />sort.PID = 104<br />sort.PGID = 103<br />sort.SID = 101<br /><br />the pg leader for pg 103 is ls (103):<br />ls.PID = ls.PGID = 103 = sort.PGID<br />however<br />ls.SID = 103 != 101 = sort.SID<br /><br />We have two processes in the same process group belonging to different sessions!<br /><br />ls is prevented from calling setsid() because as current process leader its PGID doesn't change when it is set to its PID, while its SID changes. Thus it would leave the session while staying in the process group.<br /><br />Sort, OTOH, can call setsid(), becuase it also leaves the process group:<br />sort.PID=104<br />sort.PGID=104 # leaves process group too<br />sort.SID=104<br />sort.CTTY=&lt;none&gt;<br /><br />fork(2)-ing and calling setsid(2) in the child helps, because the child gets a new PID, which will be different from any PGID of the parent (as that PGID was the PID of some process), and so when the child calls setsid(2), the child.PGID := child.PID operation will actually change the child's inherited PGID and so the child will be able to leave the process group.<br /><br />Right after fork():<br />parent.PGID = some_old_PID<br />child.PID = new_PID<br />child.PGID = parent.PGID = some_old_PID<br /><br />The child calls setsid():<br />child.PGID = child.PID = new_PID != some_old_PID = parent.PGID<br /><br />A session leader *could* call setsid(), despite also being a process group leader, since neither its PGID nor its SID would change. However, its CTTY would be set to &lt;none&gt;, and this would result in a situation where the original controlling process (= a session leader with a CTTY), for example, your shell, has no more access to the terminal! <br /><br />Furthermore, there is the rule that when a controlling process dies, each session member (each process P with P.SID = SL.SID) loses access to the terminal (and possibly get a SIGHUP on the next read/write). This clearly shows the intent that no session member shall have access to the terminal when the session leader has none. This principle would be violated if the current session leader could detach from the CTTY by calling setsid(). (Or all session members would have to lose access to the CTTY, just as if the session leader died.)</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="264" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="264" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Thu 25-Dec-2008 19:19</div><div class="forum2">good job &amp; best introductory for TTY</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="265" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="265" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Mon 20-Apr-2009 08:28</div><div class="forum2">amazing man , this is amazing !!! best tty article ever</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="307" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="307" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Tue 2-Jun-2009 19:27</div><div class="forum2">very good article!</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="331" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="331" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Mon 15-Jun-2009 16:10</div><div class="forum2">Holy Smokes dude, those were the days!<br /><br />Riff<br />www.absolute-anonymity.us.tc</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="342" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="342" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Mon 15-Jun-2009 19:59</div><div class="forum2">I rarely comment on Blogs as I usually feel my input would not be necessary, but I must say this has been one of the best written and descriptive documents I have had the pleasure of learning from</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="343" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="343" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Mon 15-Jun-2009 22:41</div><div class="forum2">ZZZZZZZZZZZZZZZZZZZZZZZZZZ to long, jesus christ write up a summery for us lazy people</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="344" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="344" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Tue 16-Jun-2009 00:22</div><div class="forum2">I've been looking for an article like this for a very long time... thanks very much for putting this together!</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="347" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="347" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Tue 16-Jun-2009 02:38</div><div class="forum2">Great summary, and very useful. Thanks!</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="349" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="349" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Tue 16-Jun-2009 06:57</div><div class="forum2">Just freaking great!<br /><br />script to make commands like less (more) adapt to changed screen size.<br />It even tries to exit from the command leaving the cursor on the &quot;correct&quot; place.<br />The kludge should work well with anything, that ought to be updated because of<br />a change in terminal window size.<br /><br />CAVEATS<br />It's written for Unix under Mac OsX, doesn't really know if tput are implemented under Linux.<br /><br />Well here we go. I'm sorry for the loss of tabs, it should have been indented.<br />I have used this for a year and a half and it really works. <br /><br />#! /bin/bash <br />export LESS=&quot; -I -r -f -J -S -g -M -x 4&quot;<br /># -I ignore case when searching<br /># -r &quot;raw&quot; do not preparate ctrl-chars, <br /># -f force open special files (may be binary) BEWARE OF ANSISEQUENCES. <br /># -J show status column <br /># -S chop long lines.<br /># -g highlight on last hit in the search. <br /># -M Most Verbose status column...<br /># -x 4 tabspacing = 4<br /># -------------------------------------- the kludge starts here.................<br />ORIGLINES=$LINES<br /><br />ESC=`printf &quot;\e&quot;`<br />ScreenRedraw_off=`echo -n &quot;$ESC&quot;&quot;[8m&quot;`<br />ScreenRedraw_on=`echo -n &quot;$ESC&quot;&quot;[0m&quot;`<br /><br />function OkayScreen() <br />{ <br /> export PS1=&quot;&quot; # Turns off the prompt to avoid cluttering..<br /> echo -n ${ScreenRedraw_off}<br /> CURLINES=`bash -i &lt; ~/bin/kludge.bash `<br /> # ^^^^^^^^^^^ NB! the path where kludge.bash should be placed.<br /> if [ $CURLINES -gt $ORIGLINES ] ; then <br /> TO_SKIP=&quot;$(expr &quot;$CURLINES&quot; '-' &quot;$ORIGLINES&quot;)&quot;<br /> if [ $TO_SKIP -lt 3 ] ; then <br /> TO_SKIP=&quot;$(expr &quot;$TO_SKIP&quot; '-' '2')&quot; <br /> else<br /> TO_SKIP=&quot;$(expr &quot;$TO_SKIP&quot; '-' '1')&quot; <br /> fi<br /> tput cuu 1 #cursor up one line<br /> echo -n ${ScreenRedraw_on}<br /> echo -n &quot;\$&quot; #restores prompt<br /> echo -n ${ScreenRedraw_off}<br /> tput cud $TO_SKIP <br /> echo -n ${ScreenRedraw_on}<br /> echo # activate cli correct position.<br /> else<br /> tput cuu 2 <br /> echo ${ScreenRedraw_on}<br /> fi<br />} <br />trap OkayScreen SIGWINCH <br /># if [ -t 0 ] ; then # /* this enables syntax highlighting */ <br /># $VIMRUNTIME/macros/less.sh $@ /* After tinkering with vim */<br /># else <br /> /usr/bin/less $@<br /># fi<br />trap '' SIGWINCH<br /># cp ./tmp/.vimrc~</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="350" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="350" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Tue 16-Jun-2009 07:05</div><div class="forum2"><div class="forumquote">Just freaking great!<br /><br />Forgot the innerpart, which makes it all work ....<br />This is a second script called kludge.bash which I have in my ~/bin folder.<br />Needs to execute this to get the changed winsize in a new process since at <br />least bash 2.05a didn't update the LINE variable in active process in the terminal window.<br /><br /><br /> <br />#! /bin/bash<br /># ### SYS Finds the number of lines in a window after window rechange - less... !#<br /># kludge.scr - to be placed in the ~/bin folder is the inner workings of the bash script named less<br />PS1=&quot;&quot;<br />shopt -s checkwinsize<br />echo $LINES</div></div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="351" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="351" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Tue 16-Jun-2009 23:58</div><div class="forum2">Thanks for the great article!<br /><br />I'd recommend adding some info about the *wide* spread myth of parent's death triggering SIGHUPs for all its children.<br /><br />Recall that the related behavior only applies to session leaders, and is triggered in any of the two following cases:<br /><br />#1:<br />IF session leader exiting<br />..IF it has ctty<br />....send SIGHUP to foreground PG<br />..ELSE<br />....send SIGHUP to foreground PG at last time it had ctty<br /><br />#2:<br />IF session leader detaching (TIOCNOTTY)<br />..send SIGHUP to foreground PG<br /><br />--JuanJo</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="352" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="352" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Wed 17-Jun-2009 10:42</div><div class="forum2">Actually, to be more precise:<br />#1:<br />IF session leader exiting<br />..IF it has ctty<br />....send SIGHUP to foreground PG<br />..ELSE<br />....send SIGHUP,SIGCONT to foreground PG at last time it had ctty<br /><br />#2:<br />IF session leader detaching (TIOCNOTTY)<br />..send SIGHUP,SIGCONT to foreground PG<br /><br /><br />See: http://google.com/codesearch/p?hl=en&amp;sa=N&amp;cd=2&amp;ct=rc#p4tPAkVsQ_c/linux-2.2.26/drivers/char/tty_io.c&amp;l=537&quot;<br /><br />--JuanJo AKA jjo</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="353" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="353" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1"><b>lft</b><br />Linus Åkesson<br />Sun 21-Jun-2009 12:58</div><div class="forum2">A reader pointed out that VT (in VT-100) stands for &quot;video terminal&quot;, not &quot;virtual terminal&quot;. This has been fixed.</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="354" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="354" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Thu 30-Jul-2009 13:07</div><div class="forum2">Thanks for the article, really helped !</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="370" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="370" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Thu 30-Jul-2009 19:09</div><div class="forum2">Thankyou, I found this to be an excellent TTY primer.</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="371" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="371" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Fri 31-Jul-2009 22:14</div><div class="forum2">Bookmarked.<br />Good tips =)</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="372" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="372" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Mon 10-Aug-2009 07:21</div><div class="forum2">Very nice. I'm currently (trying to) write a Unix-clone mostly from scratch, and this is a good resource on how TTYs are supposed to work.</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="375" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="375" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Sun 16-Aug-2009 15:32</div><div class="forum2">Hi--how are things in Sweden?<br /><br />Every once in a while I get up the ambition to complain about the width of text on a web page, and you're the lucky winner today--sorry ;-)<br /><br />This could be a good article--from the looks of it, it probably is--but why is it (and so many other web pages today) so wide? <br /><br />Checking one line at random, it is 130 characters wide: <br /><br />echo &quot;Meanwhile, however, the computers — still quite large and primitive, but able to multitask — were becoming powerful enough to&quot; | wc<br /> 1 20 130<br /><br />Oh, and I'm ignoring the stuff in the left hand panel / column--I simply horizontally scroll so that panel is not visible.<br /><br />I have three choices if I want to read your article:<br /><br /> * horizontally scroll on each line<br /><br /> * set the type size very small (or zoom out), so an entire line appears on the screen, then use a magnifying glass<br /><br /> * copy and paste the text to a file and read it in an editor--possibly deleting hard line breaks to let the text flow better.<br /><br />Ideally, and I've seen it done this way, so I believe it can be done:<br /><br /> * the text should be arranged to wrap to the width of the (reader's) window<br /><br /> * if there are long lines of code (pre-formatted text), or wide pictures, or something like that, the other text should still wrap to the width of the reader's window, although he'll have to horizontally scroll to see the full picture or code or whatever. (This is the part I'm specifically referring to as having seen done, but I can't remember any details (like an example, or how to do it--I'll try to pay attention and find some).<br /><br />Anyway, sorry for the rant--thanks for making the effort to create and disseminate pages with information like this!<br /><br />Randy Kramer</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="376" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="376" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Fri 4-Sep-2009 09:24</div><div class="forum2">Wonderful article.the explanation is meticulous and elegant. Thank you.</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="382" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="382" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Sat 12-Sep-2009 14:09</div><div class="forum2">GREAT ARTICLE!!! Read articles and books on Terminal I/O and none as clear as this summary.<br />Well Done!</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="388" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="388" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Wed 23-Sep-2009 14:26</div><div class="forum2">Thanks for a good article</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="392" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="392" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Sat 17-Oct-2009 08:12</div><div class="forum2">Thanks for this very good article</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="400" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="400" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Tue 3-Nov-2009 17:53</div><div class="forum2">Thanks for such a wonderful article. I am a beginner in tty and your article was of great help!!</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="405" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="405" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Thu 5-Nov-2009 19:54</div><div class="forum2">nice article..thanx for sharing ur knowledge :)</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="406" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="406" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Tue 22-Dec-2009 20:58</div><div class="forum2">Thanks a lot for this precise article ! This has been very useful to me... (reading an external device on RS232 from bash...)</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="434" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="434" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Tue 9-Feb-2010 07:34</div><div class="forum2">Thank you for sharing such a great artical. -Hai</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="459" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="459" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Thu 15-Apr-2010 09:08</div><div class="forum2">Thanks a lot for this great article</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="490" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="490" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Tue 4-May-2010 08:36</div><div class="forum2">Wonderful article! I never learned much about unix process stuff (apart from little practical things like piping, detaching, killing, etc), but now I feel like I'm starting to see what's behind the magical terminals! Thank you :)</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="508" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="508" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Wed 12-May-2010 01:00</div><div class="forum2">&quot;daemonizing&quot; a process - detaching from the tty - would probably also fit here. -rurban</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="519" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="519" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Thu 13-May-2010 01:17</div><div class="forum2">What does TTY mean?</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="520" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="520" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1"><b>lft</b><br />Linus Åkesson<br />Thu 13-May-2010 15:33</div><div class="forum2"><div class="forumquote">What does TTY mean?</div><br />TeleTYpe.</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="522" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="522" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Wed 14-Jul-2010 03:21</div><div class="forum2">What Randy Kramer said.</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="549" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="549" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Sat 24-Jul-2010 14:28</div><div class="forum2">excellent article, well done!</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="674" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="674" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Sun 25-Jul-2010 00:31</div><div class="forum2">The process of daemonizing is covered elsewhere, easy to Google. It involved forking, killing the parent, then calling setsid() in the child, and optionally chdir()ing to / and closing stdin/stdout/stderr. <br /><br />I am currently working on writing a toy OS, and this was very useful in its treatment of the basic structure of the TTY subsystem. Thanks.</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="700" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="700" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1"><b>ralph</b><br />Ralph Corderoy<br />Sun 25-Jul-2010 14:22</div><div class="forum2">Nice article, various points...<br /><br />The erase and kill characters used to be # and @, and as you were printing on paper there was no rubbing out, so you might see<br /><br /> $ ls @wc -l /etvc##c/passwd<br /> 42 /etc/passwd<br /> $<br /><br />where the `@' was killing the whole line entered so far and the `##' was erasing the preceding `vc'.<br /><br />It's only modern shell that provide line editing, hence shell history substitutions like `!!' and `!$' existing. If /bin/sh is a plain old non-line-editing shell on your system then you can see the difference in tty settings by using `stty -a' from another terminal to capture the differences. Don't run stty(1) from, e.g., the bash shell since the shell will alter the tty settings before running stty. Here, bash has the literal next character, lnext, being undefined and turns off -icrnl, -icanon, and -echo.<br /><br />The above example of # and @ was achieved by<br /><br /> $ sh<br /> $ stty erase \# kill @ -crterase -echok<br /> $ ls @wc -l /etvc##c/passwd<br /> 42 /etc/passwd<br /> $ stty sane<br /> $ exit<br /> $ <br /><br />where /bin/sh is dash(1) on this Ubuntu system.<br /><br />&quot;Write permissions to the device file are required, so when a user logs in on a particular TTY, that user must become the owner of the device file.&quot; I think it's read permission that's required to alter a tty's settings. It did used to be write, in the very early days, but since write(1) and mesg(1) meant users could write to one another's terminals it also meant they could alter their settings. Much fun could be had with changing erase to `e' for a second and back again at random intervals whilst the user was trying to type. So it was switched to require read permission which only the owner of tty normally has. This can be seen in stdin of stty needing to be re-directed to specify the terminal, and not stdout, e.g. `stty -a &lt;/dev/pts/1'.<br /><br />Flow control, e.g. ^S and ^Q, existed long before the signals for job control. IIRC, it was Berkeley that added all the ^Z stuff and related signals, it wasn't Bell Labs.<br /><br />The Linux kernel doesn't bother to implement all of the normal control characters. Flush is one that's missing, IIRC, which is set with stty's `eol2'. It's a shame.<br /><br />Cheers,<br />Ralph.<br /><br />P.S. There's a typo, `1970:s'.</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="735" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="735" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1"><b>lft</b><br />Linus Åkesson<br />Sun 25-Jul-2010 16:14</div><div class="forum2"><div class="forumquote"><p class="forumquote"><b>ralph</b> wrote:</p>Nice article, various points...</div><br />Thanks! That was very interesting. It hadn't occured to me that erase/kill would be usable without interactive line editing, but it makes sense.<br /><br /><div class="forumquote"><p class="forumquote"><b>ralph</b> wrote:</p>P.S. There's a typo, `1970:s'.</div><br />Changed to 1970s.</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="739" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="739" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Mon 2-Aug-2010 20:22</div><div class="forum2">How do you restart bash in tty0? For some reason my bash has died in all tty's (Ctrl-Alt-Fn). I does not show the login prompt anymore.<br /><br />How can I restart it? I cannot reboot the machine. I can ssh into it from another machine.</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="848" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="848" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1"><b>lft</b><br />Linus Åkesson<br />Thu 5-Aug-2010 08:10</div><div class="forum2"><div class="forumquote">How do you restart bash in tty0? For some reason my bash has died in all tty's (Ctrl-Alt-Fn). I does not show the login prompt anymore.<br /><br />How can I restart it? I cannot reboot the machine. I can ssh into it from another machine.</div><br />I don't know what's wrong in your particular case, but it's init (pid 1) that's supposed to (re-)start the login program in each terminal. You can modify init's configuration at runtime by editing /etc/inittab and then doing &quot;kill -HUP 1&quot;. But it's probably not an error in the configuration file, so use ps(1) to investigate what processes are running in the terminals.</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="858" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="858" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Mon 9-Aug-2010 23:41</div><div class="forum2">Great article.<br />For another great source on TTY devices you can go to:<br />http://publib.boulder.ibm.com/infocenter/aix/v6r1/index.jsp?topic=/com.ibm.aix.genprogc/doc/genprogc/ttysys.htm<br /><br />Enjoy,<br />Ori</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="872" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="872" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Fri 13-Aug-2010 10:59</div><div class="forum2">Very good article...<br />We want the part II were the concepts gets even closer to the Linux implementation...<br /><br />just an example:<br />an xterm session under ssh when resized makes the TTY device to adjust the terminal size and generate SIGWINCH signal for the running app to know about the change...<br />but if the xterm is under a serial line when resize occurs NOTHING happens (not kernel side size update, not SIGWINCH signal)... I know under serial line xterm does not communicate the size change, well where is the the place to patch in order to solve this, from the xterm side it would be very easy to send a escape sequence telling the TTY driver the new size but this driver should be patched for catching it and react as in the ssh case....<br /><br />Thanks for your out of ordinary (little or inexistant content + lot of google adds) article. I hope we can get a deeper version someday.<br /><br />Pat</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="881" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="881" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Sat 21-Aug-2010 03:00</div><div class="forum2">Hi,<br /><br />A very interesting article. I have just published a related article on the terminals in French : http://www.etud.insa-toulouse.fr/~mcheramy/wordpress/?p=198<br />(And if you don't understand french, there are few interesting links in english at the end)<br /><br />Thanks.<br />Max.</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="896" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="896" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Fri 27-Aug-2010 12:22</div><div class="forum2">How to Modify the tty driver so that control-W erases the previous word typed by the user.</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="910" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="910" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Mon 25-Oct-2010 13:14</div><div class="forum2">Nithin: thanks for the page....i got a lot of information from ur web page...</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="958" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="958" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Wed 1-Dec-2010 14:45</div><div class="forum2">Great article, very imformative please explain how to prevent UART overrun</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="987" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="987" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Thu 9-Dec-2010 18:19</div><div class="forum2">Hi there ! Would it be possible to create a raw tty which redirects input to some fifo and another tty to read from that fifo ? I know that is extrange what I'm asking...I'm building a z80 emulator and if this is possible would help me to test the input/output routines of the emulator without writting code to read/display...</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="991" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="991" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Sun 26-Dec-2010 21:32</div><div class="forum2">very helpful indeed Thanks a ton.</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="1007" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="1007" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Thu 6-Jan-2011 10:46</div><div class="forum2">Good article.Thanks you very much<br /><br />/Renjith G</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="1011" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="1011" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Wed 12-Jan-2011 13:12</div><div class="forum2">this article is very good .<br />now i have a question.<br />linux use /dev/console in booting before the init called . so i write a progrm that run after kernel booted and pass my progrm with option init in boot parameter and bypass init program so the first program that run is my program.<br />this is my question : how i correct my program to resive signels from /dev/consoole?</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="1019" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="1019" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Tue 25-Jan-2011 09:19</div><div class="forum2">Awesome article! Its been very helpful in understanding TTY layer as whole. <br /><br />Thanks<br />Ambresh</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="1032" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="1032" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Wed 9-Feb-2011 17:56</div><div class="forum2">Hi, this seems to be an excellent technical article, however is there any chance you can provide a broad description of TTY for a non technical audience. e.g. explain in simple language the origin, function and implications of TTY.<br />You may not consider this your remit, which is fair enough.</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="1040" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="1040" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Wed 16-Feb-2011 07:57</div><div class="forum2">Great Job, learned much</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="1045" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="1045" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Wed 23-Feb-2011 20:35</div><div class="forum2">Very good document, thanks!</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="1051" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="1051" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Fri 25-Feb-2011 22:10</div><div class="forum2">great article. I have known the term 'TTY' for a long time and never knew what the history behind it. Seeing how even current day UNIX system still make use of TTY is quite interesting to me. Now I feel more 'connected' when I press a key on my keyboard and seeing a character appear on the monitor screen. A good read.</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="1053" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="1053" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Tue 1-Mar-2011 21:42</div><div class="forum2">Wow! The name of the article says it all, but for real this time! Thanks!<br /><br />Regards,<br />Newman</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="1055" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="1055" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Fri 18-Mar-2011 20:18</div><div class="forum2">Amazing article. Thanks so much for putting this together. I've been using Linux for 10 years, and this taught me quite a bit.</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="1067" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="1067" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Mon 11-Apr-2011 18:08</div><div class="forum2"><div class="forumquote">ZZZZZZZZZZZZZZZZZZZZZZZZZZ to long, jesus christ write up a summery for us lazy people</div>if(easilyBored || notInterested){<br /> goToAnotherSiteThen();<br />} else {<br /> try {<br /> readAndLearn();<br /> }<br /> catch(DontUnderstandException dde){<br /> wiki(dde.getSubject());<br /> }<br /> finally {<br /> enjoyArticle();<br /> }<br />}</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="1080" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="1080" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Wed 29-Jun-2011 12:19</div><div class="forum2">Fantastic expalanation. Keep up the good work</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="1134" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="1134" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Fri 1-Jul-2011 02:12</div><div class="forum2">Greatly informative article. Of course, Bookmarked.</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="1135" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="1135" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Mon 11-Jul-2011 14:18</div><div class="forum2">Very informative article; Thanks for knowledge sharing ...</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="1145" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="1145" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Wed 7-Sep-2011 13:48</div><div class="forum2">Fucking awesome. Thanks a lot for the info!</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="1179" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="1179" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Wed 7-Sep-2011 13:49</div><div class="forum2">Fucking awesome. Thanks a lot for the info!</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="1180" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="1180" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Fri 9-Sep-2011 14:25</div><div class="forum2">Excelent article, I started to read it at work, now I'm printing it to read it more carefuly on my way home. Thanks for sharing all this!</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="1184" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="1184" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Mon 19-Sep-2011 20:32</div><div class="forum2">Thank you for sharing your knoledge so generously!</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="1190" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="1190" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Tue 27-Sep-2011 06:01</div><div class="forum2">thanks for the works!</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="1193" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="1193" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Fri 30-Sep-2011 14:39</div><div class="forum2">Hi,<br /><br />I am currently working on Solaris sparc 10, where i am seeing below problem with default setting.<br /><br />Shell is allowing me to type in only 256 characters. e.g. <br /><br />bash-3.00$ cat<br />SunStudio12u1-SunOS-SPARC-tar-MLSunStudio12u1-SunOS-SPARC-tar-MLSunStudio12u1-SunOS-SPARC-tar-MLSunStudio12u1-SunOS-SPARC-tar-MLSunStudio12u1-SunOS-SPARC-tar-MLSunStudio12u1-SunOS-SPARC-tar-MLSunStudio12u1-SunOS-SPARC-tar-MLSunStudio12u1-SunOS-SPARC-tar-MLS<br /><br />If i attempt to input more data nothing happens. After going through your notes it seems like i am crossing line buff limit. If yes can you please suggest how i can increase this limit<br /><br /><br />Minal Patil</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="1194" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="1194" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Mon 24-Oct-2011 19:11</div><div class="forum2">can anybody give exact command for sending messages via linux?</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="1199" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="1199" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Wed 2-Nov-2011 02:21</div><div class="forum2"><div class="forumquote">Hi,<br />can you please suggest how i can increase this limit<br /></div><br />http://tinyurl.com/6yql6r8</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="1202" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="1202" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Mon 14-Nov-2011 20:33</div><div class="forum2">From your disclaimer: “Please report any abuse, such as insults, slander, spam and illegal material”<br /><br />Just a note: “slander” only applies to verbal communication. For written, use the term “libel” instead. :-D</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="1208" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="1208" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Tue 22-Nov-2011 15:04</div><div class="forum2">Thanks for writing the article. It was a bit heavy going at times, but it's helped me understand some of what is going on with the whole terminal thing.</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="1210" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="1210" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Mon 12-Dec-2011 03:22</div><div class="forum2">This was enormously informative and helpful. I've bookmarked it for future use. Thank you!</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="1212" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="1212" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Wed 21-Dec-2011 03:20</div><div class="forum2">I am trying to solve a mystery with certain services started at reboot or via a root crontab.<br />These sercvices seem to fail, unless I login to a shell that has a proper TTY setup<br />(eg: PuTTY of any type of ssh session)<br />If I start up these services with a proper tty, they work and continue to run.<br />My theory is that on reboot or via root crontab there is no tty.<br /><br />How can I create a psuedo tty master/slave pair underwhich to run these services so they work, with me doing a manual ssh login......?<br /><br />Larry Wichter</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="1216" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="1216" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Thu 12-Jan-2012 14:37</div><div class="forum2">Very informative article, thanks very much for sharing it with the web.</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="1318" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="1318" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Wed 18-Jan-2012 00:00</div><div class="forum2">Real great article thanks very much.</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="1327" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="1327" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Mon 20-Feb-2012 04:35</div><div class="forum2">Superb post. Thank you.</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="1369" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="1369" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Mon 5-Mar-2012 17:15</div><div class="forum2">Great article! I'm currently running a real Teletype ASR-33 on a serial port with Ubuntu. I have to use stty to set the proper parameters for an uppercase-only terminal, change tabs to spaces, etc. Is there a way to determine what port I'm logging into (ttyS0? S1? S2, S3 or S4?) Right now, I have to run stty on all ports and get an access denied error for any port I'm not connected to. I'd like to find out what port I'm on and only run the stty on that port. Thanks for your time!</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="1382" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="1382" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Mon 2-Apr-2012 12:21</div><div class="forum2"><div class="forumquote">Is there a way to determine what port I'm logging into (ttyS0? S1? S2, S3 or S4?)</div>Sounds like a job for the tty(1) command.</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="1407" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="1407" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Mon 2-Apr-2012 17:14</div><div class="forum2">I think the commentary about line editing being part of the operating system to simplify programs is potentially misleading - the simplification of applications is a side effect.<br /><br />If you're connected something like a VT100, the terminal handles line editing, and programs send control codes to the terminal to switch between cooked mode and raw mode. When virtual terminals were implemented, this functionality became part of the operating system to maintain compatibility with existing software.</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="1408" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="1408" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Wed 11-Apr-2012 23:15</div><div class="forum2">This is a really great job! Really helped with background jobs writing to stdout and going to sleep (putting 'stty -tostop;' before background command). It takes much time to generate meaningful examples - much appreciated!</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="1419" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="1419" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Sat 14-Apr-2012 11:54</div><div class="forum2">Thanks !!</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="1430" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="1430" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Sat 14-Apr-2012 12:21</div><div class="forum2">Great Article and good writing. I came looking for one answer (which I found) and found that I could not stop reading (normally a sign of a good article).<br /><br />Having been around as the last of the Telex's died out, having designed UART circuits, worked on Xenix and Unix Systems, and naturally Linux systems, your article plugged some reasonable holes I had on the subject...<br /><br />Thanks again...</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="1431" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="1431" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Tue 17-Apr-2012 16:35</div><div class="forum2">This is a very good article and I've read and enjoyed it multiple times (no, really!).<br /><br />One thing I think it does lack is that when it's talking about signals, it should mention about Linux's new(ish) signalfd.</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="1441" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="1441" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Sat 5-May-2012 14:56</div><div class="forum2">Great and insightful article!!!<br />From this article I gain general knowledge about architecture<br />of Linux devices(LowLevelDriver&lt;-&gt;LineDiscipline&lt;-&gt;HighLevelDriver).<br />It's really a core of Linux I/O. <br /><br />Thank you very much.<br />___________________________<br />Sichkar Dmytro from Ukraine<br />dmbios@mail.ru</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="1455" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="1455" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Tue 15-May-2012 23:52</div><div class="forum2">Thank you so much. Great article!</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="1465" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="1465" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Thu 24-May-2012 15:22</div><div class="forum2">Good stuff, thanks!</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="1478" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="1478" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Mon 28-May-2012 02:48</div><div class="forum2">Thanks.</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="1480" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="1480" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1"><b>whizziwig</b><br />David Blackman<br />Mon 4-Jun-2012 17:16</div><div class="forum2">Can you explain why sometimes my terminal gets diseased, and the line I'm typing overwrites itself, or the cursor is in the wrong place, or similar symptoms? is there a way to fix it?</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="1485" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="1485" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Mon 4-Jun-2012 19:11</div><div class="forum2">Love the article, but I did have a comment -- namely that I wouldn't describe the DEC VT100 as solid state because of its CRT. Again, though, the article is great! Thanks!</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="1487" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="1487" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Tue 5-Jun-2012 07:20</div><div class="forum2">Absolutely terrific!</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="1494" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="1494" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Tue 5-Jun-2012 19:07</div><div class="forum2">That brings back old memories. The TTY shown is from the 1940's were 5 bit rather than the later 8 bit (really 7 bit plus parity) machines seen in the late 60's and 70's. Next retro core memory come back.<br /><br />RC Roeder</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="1496" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="1496" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Wed 6-Jun-2012 03:02</div><div class="forum2">Fantastic! awesome article you should think about to write a book or something, It clarified me some things, even having 5+ years of Unix experience.<br /><br />Al Mejida.</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="1499" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="1499" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Tue 12-Jun-2012 18:59</div><div class="forum2">Thanks a lot for writing this!</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="1502" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="1502" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Fri 6-Jul-2012 15:46</div><div class="forum2">&quot;yes&quot; program , produced in 2009 !<br /><br /> Thank you David McKenzie for your contribution to open source community !<br /><br /> I am just wondering what in your background that enabled the FSF to accept such worthless contribution ?<br /><br /> Member of what masonic lodge or what church or son of a war hero or billonarties you have to be so they accept that piece of crap ?<br /><br /> For reference:<br /><br /> yes command - otputs a line on tty until killed !<br /><br /> coded and added to Linux in 2009.</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="1514" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="1514" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Fri 6-Jul-2012 15:48</div><div class="forum2"><div class="forumquote">&quot;yes&quot; program , produced in 2009 !<br /><br /> Thank you David McKenzie for your contribution to open source community !<br /><br /> I am just wondering what in your background that enabled the FSF to accept such worthless contribution ?<br /><br /> Member of what masonic lodge or what church or son of a war hero or billonarties you have to be so they accept that piece of crap ?<br /><br /> For reference:<br /><br /> yes command - otputs a line on tty until killed !<br /><br /> coded and added to Linux in 2009.</div><br />interesing point although might be harsh on a boy who modified a hello world program and managed to add it to Linux.</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="1515" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="1515" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Fri 6-Jul-2012 15:50</div><div class="forum2"><div class="forumquote"><div class="forumquote">&quot;yes&quot; program , produced in 2009 !</div><br /><br /> I disagree an entire source code of the yes in TARball may be a good example of how to add a new command to Linux, sort of like a new command template.<br /><br /><br /><br />www.LinuxCAD.com</div></div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="1516" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="1516" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1"><b>lft</b><br />Linus Åkesson<br />Fri 6-Jul-2012 16:07</div><div class="forum2"><div class="forumquote">&quot;yes&quot; program , produced in 2009 !<br />...<br />Member of what masonic lodge or what church or son of a war hero or billonarties you have to be so they accept that piece of crap ?<br /></div><br />Your angry ignorance is amusing. Do you also consider echo or /dev/zero crap? Unix commands are simple by design, so that they can be combined easily. For instance, off the top of my head, here's a way to list the first 100 powers of two: (echo 1; yes 'p2*')|dc|head -n 100</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="1517" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="1517" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Fri 6-Jul-2012 21:17</div><div class="forum2">int main( in argc, char** arg)<br /> {<br /> if ( argc &lt; 2 )<br /> {<br /> printf( &quot;\nNo program, prints line to tty until killed !... please put now my name in Linux.\n&quot; );<br /> exit(1);<br /> }<br /> while(1)<br /> {<br /> printf( argv[1] );<br /> };<br /> }</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="1518" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="1518" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Fri 13-Jul-2012 17:37</div><div class="forum2">Thank you!!</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="1526" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="1526" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Sat 14-Jul-2012 03:33</div><div class="forum2"><div class="forumquote">Shell is allowing me to type in only 256 characters. e.g. <br /><br />bash-3.00$ cat<br />SunStudio12u1-SunOS-SPARC-<br /><br />Minal Patil</div><br />Can Web Master please delete this post so that the page would not be made so wide in some browser to be unreadable?<br />Thanks.</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="1527" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="1527" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1"><b>lft</b><br />Linus Åkesson<br />Sat 14-Jul-2012 11:39</div><div class="forum2"><div class="forumquote">Can Web Master please delete this post so that the page would not be made so wide in some browser to be unreadable?<br />Thanks.</div><br />I've added some &quot;max-width&quot; attributes that should fix the problem. What browser do you use?</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="1528" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="1528" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Sat 14-Jul-2012 22:18</div><div class="forum2"><div class="forumquote"><p class="forumquote"><b>lft</b> wrote:</p><div class="forumquote">Can Web Master please delete this post <br /></div><br />I've added some &quot;max-width&quot; attributes that should fix the problem. What browser do you use?</div><br />Thanks for being so responsive.<br /><br />I did realize, later, that it was just elinks that laid out the page to be annoyingly wide.<br /><br />$ elinks http://www.linusakesson.net/programming/tty/index.php<br /><br />(Use &quot;]&quot; or mouse to click near the right border of the terminal to scroll right.)<br /><br />I also found, later, that removing the posting containing a unusually long single-word helps, but a little scrolling left and right is still needed in elinks.<br /><br />Since this is restricted to an uncommon browser, don't worry about it.<br /><br />(I started using elinks on one computer due to the recent development on Linux desktop that resulted in poor support for older video cards where Firefox would freeze the entire desktop when rendering some common web content. elinks worked great for text content.)<br /><br />By the way, thanks for the page. It was a great read.</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="1530" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="1530" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1"><b>lft</b><br />Linus Åkesson<br />Sun 15-Jul-2012 20:29</div><div class="forum2"><div class="forumquote"><div class="forumquote"><p class="forumquote"><b>lft</b> wrote:</p><div class="forumquote">Can Web Master please delete this post <br /></div><br />I've added some &quot;max-width&quot; attributes that should fix the problem. What browser do you use?</div><br />Thanks for being so responsive.<br /><br />I did realize, later, that it was just elinks that laid out the page to be annoyingly wide.</div><br />I use elinks quite a lot myself, actually, for a fast, nonsense-reduced browsing experience. The page is not wider than the screen on my setup (elinks version 0.12pre5 with CSS enabled).</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="1531" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="1531" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Wed 19-Sep-2012 21:01</div><div class="forum2">It's not to keep application simple that the line discipline is in the kernel. The unix philosophy is quite the contrary, to keep the KERNEL simple, and deport to user space the handing of complexities that they don't want inside the kernel. (See for example interrupted system calls and signal handling, but that's another topic).<br /><br />The reason why the line discipline is inside the kernel, is to avoid context switches at the reception of each character (which in the early times of small core memories, would imply swap-outs and swap-ins!). So the line discipline keeps in a kernel buffer a line of input, and since it's simple enough to test for a specific byte and decrement a counter to implement the backspace &quot;editing&quot; (and a few other simple editing functions), it's done there.<br /><br />The alternative, is to use the raw mode, where the characters are forwarded to the application as soon as they're received, which is needed for more sophisticated editors, like the (at the time) famously known Eight Megabytes And Constantly Swapping editor (emacs). And indeed, since emacs had to use this raw mode, which implies a context switch at the reception of each character typed, it was constantly swapping when the computers hadn't enough memory to keep emacs and all the other programs in core.</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="1554" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="1554" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Thu 20-Sep-2012 02:54</div><div class="forum2">Thanks a lot! Was looking for this kind of information all over the place, never found anything good. If you got more please keep it coming.</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="1555" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="1555" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Thu 27-Sep-2012 22:03</div><div class="forum2">The most concise/intuitive article I've read so far on the subject. Diagrams were especially helpful. If you manage to write a book on Linux is such manner, no doubt it's going to be a bestseller... <br /><br />Thanks,<br />Val.</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="1556" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="1556" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Fri 5-Oct-2012 17:38</div><div class="forum2"><div class="forumquote">ZZZZZZZZZZZZZZZZZZZZZZZZZZ to long, jesus christ write up a summery for us lazy people</div><br />too many Zs. write a shorter insult with proper spelling for us non-moron people</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="1557" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="1557" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Sun 11-Nov-2012 20:09</div><div class="forum2">Thanks for the page. You help me a lot.</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="1580" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="1580" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Thu 29-Nov-2012 10:27</div><div class="forum2">Great job!<br /><br />I have just a suggestion.<br />This article can be used as a first step by people (like me...) who don't have a deep knowledge on the topic,<br />so why not to add a &quot;References&quot; section to help going into more depth?<br /><br />Cheers!</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="1598" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="1598" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Sun 30-Dec-2012 09:26</div><div class="forum2">Thank you very much for this great article!</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="1622" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="1622" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Fri 4-Jan-2013 15:38</div><div class="forum2">Excellent!! Thank you very much for this article. Watching and trying to understand technological issues via their historical context and being showed how they evolved make it really a pleasure to follow your explanations and very easy to get them.</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="1627" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="1627" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Wed 6-Feb-2013 01:27</div><div class="forum2">Very useful article, thanks.<br /><br />A couple of clarifications that would be great:<br /><br />1. It seems that there is a 1:1 correspondence between a session and the associated tty (bearing in mind that the associated tty may be &quot;none&quot;) - is that true? In other words, can one session include processes with different ttys, and can processes in two different sessions be associated with the same tty? (and if so... what does that mean?!)<br /><br />2. What are the exact rules for automatic raising of SIGHUP? It seems that this is raised by the TTY driver, right? Does the POSIX specification specify when this should happen and who should receive it, and does Linux follow that? I have a confusing situation involving ssh -t raising SIGHUP on exit, while logging out of an interactive ssh login apparently does not.<br /><br />Thanks<br />D</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="1646" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="1646" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Mon 11-Mar-2013 17:54</div><div class="forum2">Wow! Thanks Linus for the article.<br />This is how I learned about things in the past, from people who knew their craft well. Compare this with how we do it today - don't think, google first, rummage through incoherent posts, forums, mailing lists and if you are patient enough might be able to put pieces together to get just the clues/pointers to the information you want! So much for the 'age of information'.<br />Keep up the good work!<br />Thanks.<br /><br />- VJ</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="1661" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="1661" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Tue 2-Apr-2013 11:01</div><div class="forum2">Real very informative! Kudos to your effort and thanks for hard work!</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="1669" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="1669" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1"><b>ulzha</b><br />ulzha<br />Sun 7-Apr-2013 14:59</div><div class="forum2">Fantastic, tack så mycket!<br /><br />I'm not writing an OS, but writing an improved screen or GUI terminal I do consider.<br /><br />In particular I was interested in whether there was an API to tell foreground job's output and background job's output apart (e.g. associating a PID with each chunk output) to highlight them understandably or something. Now I figure that I just might be able to implement that by wisely trapping SIGTTOUs perhaps...</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="1679" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="1679" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Sat 18-May-2013 11:57</div><div class="forum2"><div class="forumquote"> So much for the 'age of information'.</div><br />Well, it is the age of information. Noone said it was the age of wisdom.</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="1709" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="1709" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Sat 18-May-2013 12:08</div><div class="forum2"><div class="forumquote">&quot;yes&quot; program , produced in 2009 !<br /><br /> Thank you David McKenzie for your contribution to open source community !<br /><br /> I am just wondering what in your background that enabled the FSF to accept such worthless contribution ?<br /><br /> Member of what masonic lodge or what church or son of a war hero or billonarties you have to be so they accept that piece of crap ?<br /><br /> For reference:<br /><br /> yes command - otputs a line on tty until killed !<br /><br /> coded and added to Linux in 2009.</div><br />Actually, &quot;yes&quot;, which is part of GNU coreutils, has been around since, like forever, being an implementation of the same-named Unix command.<br /><br />David MacKenzie is the author of many of coreutils' commands, including chgrp, chmod, chown, date, dirname, expand, fold, ginstall, groups, head, mkdir, mkfifo, mknod, nice, printenv, printf, rmdir, stty, su, tty, uname, unexpand, and obviously yes; and is co-author of many others. But he is probably best known for autotools, which is one of the most central pieces of free software, as any distribution maintainer could tell you.<br /><br />Now, what have YOU done for GNU or Linux or free software?</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="1710" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="1710" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Sat 24-Aug-2013 21:48</div><div class="forum2">So I was searching for information about the TTY system, and where did I, by chance, end up? Thanks for the great article. :-)<br /><br />/radiantx</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="1750" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="1750" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Fri 6-Sep-2013 12:10</div><div class="forum2">really great post ! Thanks a lot for the general understanding of the how, instead of the usual &quot;to do this, do that&quot; ! And I'll stop here because having three exclamation mark in one sentence is a clear sign of mental disorder, but thanks again.</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="1759" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="1759" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Sun 15-Sep-2013 20:58</div><div class="forum2">Excellent post on TTY!! Thank you -- Aananth C N</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="1767" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="1767" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Thu 10-Oct-2013 05:42</div><div class="forum2">thank you. very interesting.</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="1778" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="1778" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Wed 11-Dec-2013 14:19</div><div class="forum2">I'll join the crowd here to say thank you for the time you spent on this article, I've appreciated it a lot.</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="1797" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="1797" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Fri 13-Dec-2013 15:13</div><div class="forum2">Thank you. I don't think this article will EVER be outdated :P</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="1799" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="1799" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Fri 27-Dec-2013 15:55</div><div class="forum2"><div class="forumquote">Great article! I'm currently running a real Teletype ASR-33 on a serial port with Ubuntu. I have to use stty to set the proper parameters for an uppercase-only terminal, change tabs to spaces, etc. Is there a way to determine what port I'm logging into (ttyS0? S1? S2, S3 or S4?) Right now, I have to run stty on all ports and get an access denied error for any port I'm not connected to. I'd like to find out what port I'm on and only run the stty on that port. Thanks for your time!</div><br />Have you tried ls /dev/tty.* to get a listing of connected devices? On my Mac OS X this cues me into which tty device to use. I'm running a DEC Writer III. :)</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="1805" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="1805" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Tue 11-Feb-2014 19:38</div><div class="forum2">Thanks for this enlightening article! It is a bit wordy, but I completely expected that.<br /><br /><div class="forumquote">I am currently working on writing a toy OS</div><br />You work for Microsoft?</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="1819" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="1819" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Wed 12-Feb-2014 02:14</div><div class="forum2">First teletype was made in Germany around the 30s or 40s. One of the many types of teletypes was the Hellschreiber. There were also other types but all worked the same: you punch letters and they are remote printed to one or more receiving stations. After the war in the operations of confiscating the german patents, the US developed the teletype further. That's missing from your article.</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="1821" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="1821" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Fri 14-Feb-2014 08:32</div><div class="forum2"><div class="forumquote">First teletype was made in Germany around the 30s or 40s. One of the many types of teletypes was the Hellschreiber. There were also other types but all worked the same: you punch letters and they are remote printed to one or more receiving stations. After the war in the operations of confiscating the german patents, the US developed the teletype further. That's missing from your article.</div><br />The Hellschreiber device is not a teletype, it's more of a facsimile machine. You pressed a letter, and a _bitmap_ of the letter was transmitted (twice to account for mechanical asynchrony). On the receiving side, marks and spaces were literally penned onto the paper, creating two copies of the text, one atop the other. Due to said asynchrony, it was often skewed, but because two copies were printed, nonetheless legible.<br /><br />This is a very, very different mode of operation from the teletypes described above.</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="1822" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="1822" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Fri 14-Feb-2014 08:45</div><div class="forum2"><div class="forumquote">First teletype was made in Germany around the 30s or 40s. One of the many types of teletypes was the Hellschreiber. There were also other types but all worked the same: you punch letters and they are remote printed to one or more receiving stations. After the war in the operations of confiscating the german patents, the US developed the teletype further. That's missing from your article.</div><br />I don't know of the history of teletypes in Germany, but the Teletype Model 15 was first produced in 1930 and was in wide use before and after World War II. Both in military and civilian contexts.<br /><br />The Model 15 wasn't the first model produced by the Teletype corporation, but it was probably the most widely used pre-war model. It might have been the most widely used model, period.<br /><br />Like I said, I don't really know anything about German teletypes, but looking at the Wikipedia page for Hellschreiber, that device is quite different than the Teletype corporation's devices. It looks like the Hellschrieber sends pixels and might actually be more similar to FAX machines than Teletype devices.</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="1823" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="1823" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Mon 17-Feb-2014 07:42</div><div class="forum2">man! you made me see the light!</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="1825" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="1825" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Thu 27-Feb-2014 07:55</div><div class="forum2"><div class="forumquote">Hi--how are things in Sweden?<br /><br />Every once in a while I get up the ambition to complain about the width of text on a web page, and you're the lucky winner today--sorry ;-)<br /><br />This could be a good article--from the looks of it, it probably is--but why is it (and so many other web pages today) so wide? <br /><br />Checking one line at random, it is 130 characters wide: <br /><br />echo &quot;Meanwhile, however, the computers — still quite large and primitive, but able to multitask — were becoming powerful enough to&quot; | wc<br /> 1 20 130<br /><br />Oh, and I'm ignoring the stuff in the left hand panel / column--I simply horizontally scroll so that panel is not visible.<br /><br />.....<br /></div><br />You mean you aren't browsing this page with a teletype?</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="1829" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="1829" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Thu 10-Apr-2014 12:05</div><div class="forum2">&gt; Writing to a TTY which is stopped due to flow control, ...... will block your process<br /><br />I can't understand? The process will not blocked when TTY is stopped by flow control(ctrl+S), the foreground process will continue running. The only difference is I can't see the display until I type ctrl+Q again.<br /><br />Thanks for you article<br />nyu</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="1839" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="1839" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Thu 10-Jul-2014 11:03</div><div class="forum2"><div class="forumquote">&gt; Writing to a TTY which is stopped due to flow control, ...... will block your process<br />I can't understand? The process will not blocked when TTY is stopped by flow control(ctrl+S), the foreground process will continue running. The only difference is I can't see the display until I type ctrl+Q again.</div><br />You're right Nyu... and this running process may be blocked when the TTY kernel buffer is full of non-displayed characters, if it outputs too much on stdout/stderr.<br />I guess the author has taken a shortcut when writing this, as the flow control stop is often used to block a too verbose process and to be able to read few lines before let it go on again.<br /><br />Yves</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="1866" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="1866" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Mon 14-Jul-2014 11:16</div><div class="forum2">great post!!</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="1867" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="1867" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Thu 24-Jul-2014 09:39</div><div class="forum2">Hi!<br />I'm struggling with RS485 communication:<br />Is it possible to configure a tty to automatically raise the RTS line before sending and lower the RTS line after sending?<br />Thank you for your input,<br />Helmut</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="1870" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="1870" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Mon 28-Jul-2014 11:13</div><div class="forum2">the VT100 was not a colour terminal as the text suggests, though.</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="1875" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="1875" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Mon 28-Jul-2014 22:07</div><div class="forum2">Unix purist &lt;- I WAS HERE +1 great article</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="1876" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="1876" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Tue 5-Aug-2014 09:29</div><div class="forum2">Great article - I will recommend it to my network.<br /><br />Kind regards,<br />Christian from Germany</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="1882" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="1882" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Tue 2-Sep-2014 16:01</div><div class="forum2"><div class="forumquote">the VT100 was not a colour terminal as the text suggests, though.</div><br />seems so, just checked the manuals online. http://www.vt100.net/docs/<br /><br />do you perhaps know which terminal introduced color attributes for escape sequences?</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="1898" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="1898" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Thu 4-Sep-2014 23:13</div><div class="forum2">The Plan 9 operating system completely does away with TTY, signals, and ioctl. Everything in Plan 9 is either a file or represented as a file.</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="1900" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="1900" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Sat 13-Sep-2014 12:33</div><div class="forum2">The basic idea is that every pipeline is a job, because every process in a pipeline should be manipulated (stopped, resumed, killed) simultaneously.<br /><br />Not just pipelines, every command is a job in shell's parlance. Job is a userspace thing, only maintained by shell, not kernel.<br />http://www.gnu.org/software/bash/manual/bashref.html#Shell-Commands<br /><br />Niz</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="1905" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="1905" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Wed 24-Sep-2014 12:34</div><div class="forum2">By far the most amazing article about TTY I have ever read, thanks!</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="1907" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="1907" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Sun 12-Oct-2014 17:04</div><div class="forum2">Great article. Thank you! After 15 years of using unix and linux i finally got to the description of ttys :)</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="1909" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="1909" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Fri 14-Nov-2014 01:31</div><div class="forum2">Fantastic article. Thanks for doing all of the legwork. :)<br /><br />-pf</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="1914" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="1914" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Sun 16-Nov-2014 02:37</div><div class="forum2">Thank you so for the article!<br />And now, I know the meaning of &quot;tty&quot; and &quot;pty&quot;!<br /><br />Maya2003</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="1917" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="1917" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Wed 3-Dec-2014 15:42</div><div class="forum2">Great article, thanks a lot!</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="1926" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="1926" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Wed 14-Jan-2015 20:09</div><div class="forum2">This is the best article I have ever read about tty.<br /><br />Thanks a lot!</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="1937" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="1937" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Mon 9-Feb-2015 02:38</div><div class="forum2">Thank you !!! :)</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="1948" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="1948" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Sun 15-Feb-2015 22:47</div><div class="forum2">Yup, interesting intro to the TTY area, I think, and fun trying out the terminal tweaks..but any ideas of where I can find a good intro to using TTY in Linux, without the writer assuming I know all about networking/the Linux kernel in advance??? Please and thank-you.</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="1952" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="1952" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Sun 15-Feb-2015 22:47</div><div class="forum2">Yup, interesting intro to the TTY area, I think, and fun trying out the terminal tweaks..but any ideas of where I can find a good intro to using TTY in Linux, without the writer assuming I know all about networking/the Linux kernel in advance??? Please and thank-you.</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="1953" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="1953" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1"><b>zdennis</b><br />Zach Dennis<br />Sun 8-Mar-2015 23:07</div><div class="forum2"><div class="forumquote">Yup, interesting intro to the TTY area, I think, and fun trying out the terminal tweaks..but any ideas of where I can find a good intro to using TTY in Linux, without the writer assuming I know all about networking/the Linux kernel in advance??? Please and thank-you.</div><br />The O'Reilly book titled &quot;Termcap &amp; TermInfo&quot; should get you started: http://www.amazon.com/termcap-terminfo-OReilly-Nutshell-Linda/dp/0937175226</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="1967" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="1967" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Sat 11-Apr-2015 22:14</div><div class="forum2">best tty explanation ever written, hands down. <br /><br />thank you so very much.</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="1986" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="1986" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Tue 14-Apr-2015 23:21</div><div class="forum2">I'm not especially new to bash programming or serial ports in general, but have never delved into stty and echo.<br /><br />So I have a simple script (and I'm not sure I have the stty settings right), that should send &quot;tx c&quot; to the serial port. However, the best I can tell using minicom, if I perform the following from the command line: <br /><br /> echo tx c &gt; /dev/ttyO1<br /><br />the serial device receives:<br /><br /> tx.{<br /><br />echo aaa &gt; /dev/ttyO1 echos aay<br />echo bbbbb &gt; /dev/ttyO1 echos bbbbz<br />echo abcdefghijklmnop &gt; /dev/ttyO1 echos abeefgkijkmmnoz<br /><br />WHAT am I missing?</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="1989" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="1989" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Tue 21-Apr-2015 16:45</div><div class="forum2">This is best ever article on TTY. What an awesome job. Please keep writing such articles.<br />Chakri</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="1991" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="1991" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Fri 8-May-2015 12:00</div><div class="forum2">The best article about tty ever! no kidding.</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="1996" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="1996" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Sat 25-Jul-2015 18:08</div><div class="forum2">very useful! thanks~</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="2024" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="2024" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Thu 30-Jul-2015 04:41</div><div class="forum2">I am new to Linux but this article is so clear even i can taste 60% of them. I will read it again a couple days later because this is the best article i ever read about linux.</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="2025" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="2025" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Sat 15-Aug-2015 19:45</div><div class="forum2">amazingly clear on a very fundamental piece of technology that I never really knew about. Just the build up of the subject is a great way to approach any kind of technical writing. I'll definitely keep this post in mind when I try to tackle writing about a complicated technical subject.</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="2027" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="2027" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Sun 16-Aug-2015 03:57</div><div class="forum2"><div class="forumquote">&quot;yes&quot; program , produced in 2009 !<br /><br /> Thank you David McKenzie for your contribution to open source community !<br /><br /> I am just wondering what in your background that enabled the FSF to accept such worthless contribution ?<br /><br /> Member of what masonic lodge or what church or son of a war hero or billonarties you have to be so they accept that piece of crap ?<br /><br /> For reference:<br /><br /> yes command - otputs a line on tty until killed !<br /><br /> coded and added to Linux in 2009.</div><br /><div class="forumquote">HISTORY<br /> The yes command appeared in Version 7 AT&amp;T UNIX.<br /></div>The code for this in GNU is ridiculously long, but in other systems, the code is shorter than the license or the above comment<br /><div class="forumquote">#include &lt;stdio.h&gt;<br /><br />int<br />main(int argc, char *argv[])<br />{<br /> if (argc &gt; 1)<br /> for (;;)<br /> puts(argv[1]);<br /> else<br /> for (;;)<br /> puts(&quot;y&quot;);<br />}<br /></div></div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="2028" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="2028" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1"><b>i336_</b><br />David Lindsay<br />Tue 18-Aug-2015 16:55</div><div class="forum2">This is really cool. I've just discovered this; I might have more to add after I've properly read through it. While I remember, though, I want to mention one of the better resources I've found for terminal escape sequences: an old online manpage for dtterm(5), at<br /><br />http://www2.phys.canterbury.ac.nz/dept/docs/manuals/unix/DEC_4.0e_Docs/HTML/MAN/MAN5/0036____.HTM<br /><br />Also, the following Github Gist is updated extremely frequently (6 days ago, as I type this); it tracks terminal support for 24-bit color, a fairly new capability that's slowly gaining traction. You should be able to just expect it to be available 3-5 years from now; terminals in hyper-current distros like Arch likely have the support already.<br /><br />https://gist.github.com/XVilka/8346728</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="2029" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="2029" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Tue 22-Sep-2015 04:41</div><div class="forum2">Thanks for a great explanation of infrequently discussed, arcane, but essential part of the Unix/Linux &quot;reptile brain&quot;. Required knowledge for anyone who hopes to use Unix/Linux beyond a novice level.</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="2041" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="2041" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Mon 30-Nov-2015 09:35</div><div class="forum2">Amazing. Very very needed. Thank you very much.</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="2061" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="2061" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Fri 4-Dec-2015 08:14</div><div class="forum2">Very nice summary for those born too late :-)<br /><br />It might be worth mentioning that UARTs/serial ports have control lines to block transmission when the received data can't be processed as fast as it's received.<br />This way the UART itself would stop transmitting and the whole process was handled in hardware.<br />The sending process would have to wait (be blocked) for the UART to transmit it's data anyway, as the hardware would mostly be slower than the software anyway.<br /><br />However when modems came in to play, the terminals UART and the hosts UART were no longer directly wired to each other and modems would only transmit data and no control lines between them. This situation required another method of flow control that would have to be transmitted in-band with the data. So software flow control via device control characters was invented.</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="2064" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="2064" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Thu 7-Jan-2016 12:45</div><div class="forum2">5</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="2072" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="2072" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Tue 12-Jan-2016 16:07</div><div class="forum2">Really good document,thanks for your great efforts</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="2073" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="2073" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Fri 5-Feb-2016 14:34</div><div class="forum2">I am learning linux... and it is best article to understand what is going under the hood:) thanks for your time</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="2091" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="2091" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Sat 20-Feb-2016 01:55</div><div class="forum2">Good job demystifying TTY for me. Keep it up.<br /><br />Cheers</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="2100" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="2100" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Thu 10-Mar-2016 01:06</div><div class="forum2">This and all OK.. But.. I have one doubt for long time... In case of terminal emulator we can navigate/scroll using mouse.. How do we scroll/navigate inside TTY (I am a Linux beginner.. So sorry if it's a stupid question)</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="2102" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="2102" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1"><b>lft</b><br />Linus Åkesson<br />Tue 29-Mar-2016 22:35</div><div class="forum2"><div class="forumquote">This and all OK.. But.. I have one doubt for long time... In case of terminal emulator we can navigate/scroll using mouse.. How do we scroll/navigate inside TTY (I am a Linux beginner.. So sorry if it's a stupid question)</div><br />Hi! That is not handled by the TTY layer, it is done by the terminal emulator itself. Whenever something scrolls off-screen, it is appended to a scrollback buffer, which you can then view using GUI controls or keyboard shortcuts.</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="2108" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="2108" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Wed 30-Mar-2016 22:02</div><div class="forum2">Yes! More than I was looking for, but I'm not complaining. Brilliant article, and now I know enough to stay the fuck away until I must.</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="2112" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="2112" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Sat 9-Apr-2016 01:04</div><div class="forum2">really cool thanx to share your knowledge</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="2117" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="2117" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Sun 10-Apr-2016 03:34</div><div class="forum2">Hello Linus! I have a question about what happens when you kill a process in raw mode. If you launch, say, vim in a terminal and then run `killall -9 vim` from a separate terminal, you would expect the original terminal to be left in raw mode after vim exits (as if you had run `stty raw` or something). However, surprisingly, it is left in canonical mode. I have tried this with multiple shells, terminal emulators, and OS's, and only urxvt behaves differently from this. My question is, what mechanism resets the terminal in this case?<br /><br />-- kc</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="2118" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="2118" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1"><b>lcu</b><br />Luis Colorado<br />Thu 14-Apr-2016 14:19</div><div class="forum2"><div class="forumquote">Hello Linus! I have a question about what happens when you kill a process in raw mode. If you launch, say, vim in a terminal and then run `killall -9 vim` from a separate terminal, you would expect the original terminal to be left in raw mode after vim exits (as if you had run `stty raw` or something). However, surprisingly, it is left in canonical mode. I have tried this with multiple shells, terminal emulators, and OS's, and only urxvt behaves differently from this. My question is, what mechanism resets the terminal in this case?<br /><br />-- kc</div>Historically, the UNIX tty driver used to reset terminal settings to known values (300bps, some parity, cooked mode, etc.) in close() callback (which was called by the kernel only on last close to the device only) but this was found nonsense, because normal initial session programs like old /etc/getty (yes, it was stored there) were to initialize it fully. This had some drawbacks, because this last close could happen when not needed and the reasons to conserve settings between close where significant.<br /><br />This requirement has been dropped from linux kernel and now linux allows you to fix terminal settings from a previous shell command without losing those settings because of a last close issue.</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="2120" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="2120" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Fri 22-Apr-2016 04:21</div><div class="forum2">Thank you sir. You have been helpful.</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="2122" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="2122" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Mon 16-May-2016 21:57</div><div class="forum2"><div class="forumquote">Thank you. I don't think this article will EVER be outdated :P</div>The images of it already are on high resolution monitors.</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="2128" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="2128" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Thu 23-Jun-2016 20:00</div><div class="forum2">Best article regarding this mess!</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="2144" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="2144" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Fri 15-Jul-2016 21:14</div><div class="forum2">This is just awesome! I have old phone co UNIX books that don't go into this depth! Thx for this info</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="2152" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="2152" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Sat 16-Jul-2016 19:19</div><div class="forum2">Nice one. Thanks.</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="2153" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="2153" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Sat 23-Jul-2016 14:39</div><div class="forum2">I'm using python on Debian os.<br />I've interfaced bluetooth to uart.<br />The data coming from bluetooth is received and can be monitored on ttyS0.<br />Can someone tell me how to copy that data.<br />I want to paste it in a text file</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="2155" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="2155" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Mon 29-Aug-2016 22:34</div><div class="forum2"><div class="forumquote">&quot;yes&quot; program , produced in 2009 !<br /><br />.... cut ....<br /><br /> For reference:<br /><br /> yes command - otputs a line on tty until killed !<br /><br /> coded and added to Linux in 2009.</div><br />Interesting! I remember I made a joke with yes program to my friend in 1996 by using Slackware Linux I.e. Linux kernel so new.</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="2163" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="2163" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Mon 29-Aug-2016 23:03</div><div class="forum2"><div class="forumquote">I'm not especially new to bash programming or serial ports in general, but have never delved into stty and echo.<br /><br />So I have a simple script (and I'm not sure I have the stty settings right), that should send &quot;tx c&quot; to the serial port. However, the best I can tell using minicom, if I perform the following from the command line: <br /><br /> echo tx c &gt; /dev/ttyO1<br /><br />the serial device receives:<br /><br /> tx.{<br /><br />echo aaa &gt; /dev/ttyO1 echos aay<br />echo bbbbb &gt; /dev/ttyO1 echos bbbbz<br />echo abcdefghijklmnop &gt; /dev/ttyO1 echos abeefgkijkmmnoz<br /><br />WHAT am I missing?</div><br />Not sure about your system but in my old linux systems with serial port, device was ttyS01 but not tty01.</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="2164" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="2164" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Mon 29-Aug-2016 23:11</div><div class="forum2"><div class="forumquote">This and all OK.. But.. I have one doubt for long time... In case of terminal emulator we can navigate/scroll using mouse.. How do we scroll/navigate inside TTY (I am a Linux beginner.. So sorry if it's a stupid question)</div><br />Shift+page up/down<br /><br />This will do the job both in fyi terminal emulators and the ones on TTYs (ctrl+alt+F1, etc.).</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="2165" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="2165" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Mon 29-Aug-2016 23:23</div><div class="forum2"><div class="forumquote"><div class="forumquote">I'm not especially new to bash programming or serial ports in general, but have never delved into stty and echo.<br /><br />So I have a simple script (and I'm not sure I have the stty settings right), that should send &quot;tx c&quot; to the serial port. However, the best I can tell using minicom, if I perform the following from the command line: <br /><br /> echo tx c &gt; /dev/ttyO1<br /><br />the serial device receives:<br /><br /> tx.{<br /><br />echo aaa &gt; /dev/ttyO1 echos aay<br />echo bbbbb &gt; /dev/ttyO1 echos bbbbz<br />echo abcdefghijklmnop &gt; /dev/ttyO1 echos abeefgkijkmmnoz<br /><br />WHAT am I missing?</div><br />Not sure about your system but in my old linux systems with serial port, device was ttyS01 but not tty01.</div><br />It seems ttyO1 works for you.<br />Maybe outrun a CR and LF at the end of the echoed words will help.<br />Indeed CR may not be needed.<br /><br />Try this:<br />echo bbbbb\n\r &gt; /dev/ttyO1<br /><br />Hope it works *fingers crossed* :)</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="2166" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="2166" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Mon 29-Aug-2016 23:29</div><div class="forum2">I have been with Linux and UNIX systems since 1994. They were good old days and I am learning these amazing knowledge just now from this article.<br />Fantastic job Linus. Thank you so much!<br /><br />Bedri Özgür Güler</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="2167" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="2167" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Thu 6-Oct-2016 19:39</div><div class="forum2"><div class="forumquote"> * the text should be arranged to wrap to the width of the (reader's) window<br /></div><br />Whilst I agree with you entirely, this article wraps just as you request.<br /><br />Of course, it may have been altered in the many years since you wrote your comment :-) but credit where credit is due!</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="2171" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="2171" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Sun 20-Nov-2016 21:14</div><div class="forum2">Wow, very impressive style of writing, thank you very much.<br />Great article.<br />Would be awesome something like that about handling keycodes(infocmp &amp; friends).</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="2183" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="2183" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Sun 11-Dec-2016 23:47</div><div class="forum2">I have a small question.<br /><br />Can you tell me when the /dev/ttyXXX or /dev/pts/X are added in the /dev directory ?<br /><br />Initially, I thought that each program had its own /dev/ttyXXX device. When is the kernel adding a new /dev/ttyXXX device ?<br /><br />Let say that I add the following lines in /etc/rc.local<br /># Start these program during the init.<br />/home/user/prog1 &amp;<br />/home/user/prog2 &amp;<br />/home/user/prog3 &amp;<br /><br />Will it create one or three new /dev/ttyXXX device ?<br />(or will it reuse another one that is already present?)<br /><br />Thanks for this article.</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="2189" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="2189" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Sun 12-Feb-2017 05:50</div><div class="forum2"><div class="forumquote">ZZZZZZZZZZZZZZZZZZZZZZZZZZ to long, jesus christ write up a summery for us lazy people</div><br />That was the &quot;summery&quot;; you are an insult to lazy people everywhere.<br /><br />But you have redeemed yourself with a great toast: To long, jesus christ! &gt;clink!&lt;</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="2212" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="2212" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Sat 18-Feb-2017 19:46</div><div class="forum2">Thank you Linus. Really helped me understand this stuff.</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="2218" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="2218" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Mon 13-Mar-2017 07:49</div><div class="forum2">This was extremely helpful, thanks!</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="2226" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="2226" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Wed 15-Mar-2017 12:28</div><div class="forum2">&gt; In The Hitchhiker's Guide to the Galaxy, Douglas Adams mentions an extremely dull planet, inhabited by a bunch of depressed humans and a certain breed of animals with sharp teeth which communicate with the humans by biting them very hard in the thighs. This is strikingly similar to UNIX, in which the kernel communicates with processes by sending paralyzing or deadly signals to them. Processes may intercept some of the signals, and try to adapt to the situation, but most of them don't.<br /><br />This is the only thing I could find about it, do you have any reference for that?</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="2228" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="2228" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Sun 7-May-2017 22:25</div><div class="forum2">amazing article!<br /><br />thank you very much</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="2286" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="2286" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Tue 13-Jun-2017 21:18</div><div class="forum2">Just wanted to leave another pile of thanks for this great article.<br />Regards, <br />jvlns</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="2303" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="2303" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Mon 3-Jul-2017 22:01</div><div class="forum2">Linus,<br /><br />I read this a few years ago and have just re-read today. This is one of the best and clearest explanations of anything, never mind something as dry and arcane as tty.<br /><br />You have a great talent for this, many thanks.</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="2312" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="2312" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Mon 17-Jul-2017 20:16</div><div class="forum2">Thanks for that nice write-up. Actually, I just came here because I don't want linux to mess with my payload over the serialport, is there a quick way to tell the tty to simply forward everything and _not_ mess with it?<br /><br />I've tried stty &quot;raw&quot; option, it's still messing around though.</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="2315" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="2315" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Mon 24-Jul-2017 05:03</div><div class="forum2">I have been always wondering how tty works for years and could not get a clear idea until today I stumbled on this write up, an admirable article! Thank you!</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="2318" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="2318" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Tue 26-Sep-2017 00:17</div><div class="forum2">&quot;To facilitate moving the terminal emulation into userland,(...) inside pseudo terminals, à la screen(1) or ssh(1)...&quot;<br /><br />What means &quot;à la screen&quot; ? do you speak french too ;) ?<br />Really interesting and original web site, i wonder where you find the time to do so many things (time consuming things)...<br /><br />Thanks for your writing</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="2338" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="2338" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Mon 11-Dec-2017 19:21</div><div class="forum2">@OP, Btw do you have any &quot;to the metal&quot; UNIX/linux books to recommend that has information regarding such stuff?</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="2358" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="2358" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Wed 20-Dec-2017 22:15</div><div class="forum2">Amazing article!</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="2360" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="2360" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Thu 11-Jan-2018 03:39</div><div class="forum2">You are a Rocket Scientist!</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="2365" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="2365" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Tue 6-Feb-2018 17:48</div><div class="forum2">10 years old, still the best article on TTYs. Still getting comments. Not a record ( I presume ) but noteworthy. <br /><br />Thank you very much Linus. I understand my particular problem - my expect script has to send a \n character at login - much better now. <br /><br />To long !, Jesus Christ.</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="2370" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="2370" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Thu 22-Feb-2018 02:08</div><div class="forum2">Returning to Unix/Linux after 30 year gap. If only all documentation was as clear as this. Excellent. Thanks.</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="2374" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="2374" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Thu 22-Feb-2018 05:58</div><div class="forum2">An awesome article, it helps a lot! Thanks from china.</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="2375" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="2375" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Sun 22-Apr-2018 00:39</div><div class="forum2">Thank you very much for this amazing article!<br />Indeed, some things had been demystified :)</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="2386" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="2386" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Fri 18-May-2018 05:00</div><div class="forum2">Beautifully written and comprehensive enough for UNiX beginners like me. Thank you!</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="2395" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="2395" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Wed 18-Jul-2018 20:44</div><div class="forum2">Thanks for the introduction of TTY!</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="2403" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="2403" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Sat 28-Jul-2018 00:46</div><div class="forum2">I thought that it would be helpful to leave a comment about something that confused me.<br /><br />Why, when -tostop was set on the terminal, did the editor get sent a SIGTTOU but the backgrounded (sleep 5; echo ...) did not?<br /><br />I used strace on the editor process and found that it was calling ioctl() right before receiving a SIGTTOU:<br /><br />--- SIGCONT {si_signo=SIGCONT, si_code=SI_USER, ...} ---<br />ioctl(5, SNDCTL_TMR_STOP or TCSETSW, {...}) = ...<br />--- SIGTTOU {si_signo=SIGTTOU, si_code=SI_KERNEL} ---<br />--- stopped by SIGTTOU ---<br /><br />In the Linux kernel source, I found that the code that handles an ioctl request for TCSETSW will unconditionally check if the process is in the foreground process group of the tty, and send SIGTTOU if it isn't.<br /><br />But, at least in the write handler for N_TTY, the same check is *only made if the TOSTOP bit is set*.<br /><br />So, -tostop will allow a backgrounded process to write to the terminal but it will not allow a backgrounded process to call ioctl(..., TCSETSW, ...) on it.</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="2407" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="2407" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Wed 12-Sep-2018 17:03</div><div class="forum2"><div class="forumquote"> which terminal introduced color attributes for escape sequences?</div><br />DEC's VT241?</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="2417" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="2417" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Wed 12-Sep-2018 17:07</div><div class="forum2"><div class="forumquote">However when modems came in to play, the terminal's UART and the host's UART were no longer directly wired to each other and modems would only transmit data and no control lines between them. This situation required another method of flow control that would have to be transmitted in-band with the data. So software flow control via device control characters was invented.</div><br />This flow-control pre-dates modems. The ^S/^Q characters _are_ the ASR-33 teletype's codes for turning off and on (respectively) the paper tape reader. Systems would issue them to prevent their processing programs from being overrun by automated input from tape. Later they were generalized into line disciplines, etc.</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="2418" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="2418" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Thu 8-Nov-2018 08:42</div><div class="forum2">Excellent comprehensive article on tty, thx Linus!</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="2436" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="2436" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Fri 9-Nov-2018 22:35</div><div class="forum2">Great and informative read indeed! I feel a bit more confident tinkering my terminal now. Also learnt quite a lot on signal and process concepts. Thanks :)</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="2437" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="2437" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Sat 29-Dec-2018 20:10</div><div class="forum2">Thanks for an informative article. I really learned something!<br />-Tom</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="2465" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="2465" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Wed 2-Jan-2019 17:13</div><div class="forum2">Brilliant article! Thanks a lot!</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="2466" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="2466" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Tue 29-Jan-2019 19:59</div><div class="forum2">Thank you for the wonderful article!</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="2475" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="2475" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Wed 27-Feb-2019 09:17</div><div class="forum2">I am loving you hard.<br /><br />Catatonic</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="2492" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="2492" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Mon 11-Mar-2019 14:12</div><div class="forum2">superb, fantastic -- opened a new world for me.<br /><br />Thank you</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="2497" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="2497" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Fri 24-May-2019 14:34</div><div class="forum2">Thanks! Great article!</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="2520" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="2520" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Wed 5-Jun-2019 06:01</div><div class="forum2"><div class="forumquote">ZZZZZZZZZZZZZZZZZZZZZZZZZZ to long, jesus christ write up a summery for us lazy people</div><br />Haha, this article IS the summary</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="2522" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="2522" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Fri 7-Jun-2019 00:01</div><div class="forum2">How do a program should propperly handle a &quot;/dev/pts&quot;? I mean, I am able to open that device for read and write, the program is effectively writing and reading stuff, but when I want to close the program gracefully and close the file descriptor used to open the device, the program crashes with no clue on what has happened.<br />Thanks for the excellent work!</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="2526" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="2526" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Sat 8-Jun-2019 23:57</div><div class="forum2">Having read your wonderful article, am feeling obliged to give my thanks. BIG thanks! :)</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="2527" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="2527" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Thu 20-Jun-2019 21:03</div><div class="forum2">Amazing stuff! Thank you!</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="2533" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="2533" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Thu 1-Aug-2019 18:33</div><div class="forum2">Absolutely amazing post.</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="2549" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="2549" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Mon 5-Aug-2019 06:09</div><div class="forum2">This is a fantastic guide. As you say, it's hard to find straightforward information about how the tty system works.</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="2551" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="2551" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Thu 29-Aug-2019 23:58</div><div class="forum2">Thanks for the great post!!</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="2561" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="2561" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Tue 24-Sep-2019 03:54</div><div class="forum2">lucid explanation. much makes sense on terminals in stevens/kerrisk linux api guide<br /><br />thanks!</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="2573" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="2573" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1"><b>Waverley</b><br />Jim Fergusson<br />Sat 5-Oct-2019 13:35</div><div class="forum2">a really excellent article on a subject that mystified me - (and I'm an old guy who remembers punched tape 'telex' as the main communication channel between our company and it's Connecticut USA parent) - thanks so much for this Mr Akesson!</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="2578" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="2578" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Mon 11-Nov-2019 01:19</div><div class="forum2">For me, background processes are able to write to the terminal. For example, <br /><br />[ ~]$ python -c &quot;import time; time.sleep(10); print('hello');&quot;<br />^Z<br />[2]+ Stopped python3 -c &quot;import time; time.sleep(10); print('hello');&quot;<br />[ ~]$ bg<br />[2]+ python3 -c &quot;import time; time.sleep(10); print('hello');&quot; &amp;<br />[ ~]$ hello</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="2588" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="2588" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Fri 27-Dec-2019 21:05</div><div class="forum2">Trying to use GDB GUI application, with two terminals, and you find out this information bringing some light when you want control on the execution screen. New decade and still useful info.</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="2601" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="2601" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Sat 29-Feb-2020 19:59</div><div class="forum2">Total shit. Doesn't explain how the tty works, nor how the shell connected to tty/pty.</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="2620" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="2620" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1"><b>Ruslan63</b><br />Ruslan Poddubny<br />Thu 12-Mar-2020 13:02</div><div class="forum2">If it's possible: How is related /dev/ack with /dev/tty?</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="2621" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="2621" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Fri 7-Aug-2020 13:10</div><div class="forum2">wow</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="2656" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="2656" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Tue 18-Aug-2020 07:18</div><div class="forum2">O.M.G.!!!</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="2659" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="2659" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Mon 31-Aug-2020 23:52</div><div class="forum2">Great article, thank you for putting this together!</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="2661" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="2661" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Mon 7-Sep-2020 18:33</div><div class="forum2">I didn't get exactly how pty came into picture and what is the usage of that. <br />Looking forward to get more info on that.</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="2665" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="2665" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Wed 30-Sep-2020 06:55</div><div class="forum2">Really informative! good article!</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="2671" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="2671" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Tue 13-Oct-2020 22:11</div><div class="forum2">is this troll ..vik</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="2677" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="2677" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Tue 3-Nov-2020 23:23</div><div class="forum2">Thank you! Still informative in 2020! After so many years, there's still not article explains TTY better than this.</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="2684" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="2684" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Sun 17-Jan-2021 14:03</div><div class="forum2">Thanks for your article</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="2712" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="2712" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Sun 28-Feb-2021 22:16</div><div class="forum2">Dear Mr. Linus Åkesson,<br /><br />Thank you for the extremely informative article. I'm an amateur programmer and Linux newbie and trying to wrap my head around TTY as I'm exploring the capabilities of the new &quot;iSH&quot; iPad app which runs Alpine Linux inside an x86 emulator on iPadOS on an iPad. The Alpine Linux wikis ay that Alpine Linux can be set up to do graphics and a GUI, but I've not been able to so via the iSH app. When I try to do so, my X or Xorg or xterm programs usually either tell me that they &quot;Can't open display&quot;or that it &quot;Cannot find a free VT: Not a tty&quot;. When I use the Linux tty command, it shows the active tty as /dev/pts/0 which I understand would be expected since I am in a Bash shell inside Linux typing the command. I wrote the app developer who indicated that the App isn't really set up to graphics. Setting the env $DISPLAY to the host:0.0 also does not help. <br /><br />My questions for you that I'm confused about is how could the App not be able to do graphics, access the display, or find a free tty if it is able to display the text characters on the terminal? Why can't X11 use the same procedure that the Bash Linux shell uses to display text characters on my iPad to display graphics? I did notice that the same difficulty comes up when using Alpine Linux Docker containers--they seem to only natively display text characters in a terminal window. I read that one can set up such Alpine Linux Docker containers to display graphics/GUI information but to do so one has to set up the Docker container to specifically transmit such graphic information to the local computer's tty display. I'm guessing that the difficulty Alpine Linux Docker containers might have in natively displaying graphic/GUI information (as opposed to text character shell information) might be related to the same limitation I might be having in trying to get the Alpine Linux kernel in the iSH app to display graphic/GUI information on my iPad but don't understand mechanistically why.<br /><br />If you could explain the difference between Linux being able to display character text information on a tty display versus being able to display graphic/GUi information on the same tty display (perhaps with some supplemental diagrams to your original article), I (and suspect others) would greatly appreciate it.<br /><br />Thanks,<br />MIke</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="2717" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="2717" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Thu 11-Mar-2021 16:15</div><div class="forum2"><div class="forumquote">Dear Mr. Linus Åkesson,<br />(..)<br />MIke</div><br />Hey MIke,<br /><br />Not Linus Akesson but I might clear up the confusing here, I admit it is a topic that can lead to much confusion. I took a quick peek into &quot;iSH&quot; but keep in mind iOS is not my forte, nor do I fully know how &quot;iSH&quot; is implemented. In that regard I do not know what is possible and what is not but I give my educated guess at the end. <br /><br />To clear up any confusion about a &quot;tty&quot; and &quot;bash&quot;: both have absolutely nothing to do with anything graphical, be it rendering text on a terminal or doing anything GUI related. <br /><br /> - &quot;bash&quot; is simply a shell like there are many other shells (&quot;sh&quot;, &quot;zsh&quot;, &quot;ksh&quot;). To really oversimplify things: &quot;bash&quot; reads input bytes (your commands you type for example) and spawns processes. These processes produce output. Bash does not intercept this output nor does it render text. For example, if you type &quot;ls&quot; and press enter, it reads the command, creates a new process (&quot;ls&quot;) and that process produces output.<br /><br /> - A &quot;tty&quot; neither has anything to do with rendering text. You can read and write to a &quot;tty&quot;. The article explains the &quot;tty&quot;'s role: It is a passive object with some data fields. Just like a normal file you can read and write to the &quot;tty&quot;. A keyboard can for example write to a &quot;tty&quot;, &quot;bash&quot; can read that data from the &quot;tty&quot;. The &quot;ls&quot; process can write to the &quot;tty&quot; and a &gt;virtual terminal&lt; (e.g. xterm) can read that data from the &quot;tty&quot;. The &quot;tty&quot; also contains data about processes for example who the foreground process is in order to direct signals to the right process and process groups. <br /><br />Then who is responsible for the actual rendering? The (virtual) terminal (not the &quot;tty&quot;) plays a central role here. If we only focus on a virtual terminals we have basically two cases mentioned in the article. <br /><br /> 1. The virtual terminal process resides in kernel space (called the console).It reads from the &quot;tty&quot;, say the output from the &quot;ls&quot; process and renders the text. It interacts with the VGA driver to do so. <br /> <br /> 2. The virtual terminal process resides in user space: An example of virtual terminal is &quot;xterm&quot;, &quot;gnome-terminal&quot; is another, &quot;st&quot;, the one I use, but here are many more. The virtual terminal has the same tasks as the kernels virtual console but instead of interacting with the VGA driver it interacts with a display server (Xorg for example). The display server in turns interacts with the videocard drivers to render graphical output. <br /><br />In short a &quot;tty&quot; has so little to do with rendering anything that a &quot;tty&quot; does not even need to be connected to a virtual terminal. A ssh server for example reads from a socket, writes to a &quot;tty&quot; and returns the output back over the connection to a ssh client. The ssh client writes the results to a &quot;tty&quot; and your virtual terminal process reads it and presents it to the screen. <br /><br />As far as the 'iSH' app is concerned: it seems that it merely emulates a virtual terminal. To do anything GUI related in a linux enviroment you should have a display server running (e.g. Xorg) that interacts with the linux video display drivers. Opening &quot;xterm&quot; in &quot;iSH&quot; is like starting a new virtual terminal from a virtual terminal you are already in (&quot;iSH&quot;). So in order to start a graphical user interface you have to install a display server and all display drivers which I doubt &quot;iSH&quot; can do (hence the response from the developer 'it is not really set up to do anything graphical'). <br /><br />I hope this helps,<br />Bennie</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="2719" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="2719" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Fri 12-Mar-2021 03:28</div><div class="forum2">Wow, Bennie, thanks for that thorough response, and it does help. I thought the TTY might be the answer to most of my questions, but I now understand that it is much more complex than that.<br /><br />Have a good week,<br /><br />Mike</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="2720" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="2720" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Sat 13-Mar-2021 16:34</div><div class="forum2">A well formulated question deserves a proper answer I think. Besides, you did your research by even contacting the app-developer. Happy to help :).<br /><br />To go a bit off topic regarding the article (since noone is really posting here anyway) and to say a bit about running linux on an ipad I think you have three options. What you want depends on your goals (but running iOS apps inside linux will not be possible).<br /><br />1. Either/or linux/iOS: jailbreak<br />If you want to run a full fletched linux OS on the ipad an option is to jailbreak the ipad and try to install linux. This is hard because Apple does not want you to and a failed installation might render the ipad useless. Also you will not be able to run any iOS apps anymore obviously.<br /><br />2. Interact with the ipad linux-like: 'iSH'<br />To interact with the ipad like running xterm is using the 'iSH' app, the reason I think it was created . I'm not totally sure what the app is capable of but I guess you can do pretty much anything with your system as on a normal linux distribution, as long as it does not require GUI applications (except perhaps starting iOS apps you already have installed).<br /><br />3. Running linux on top of iOS: Virtualisation Software<br />The last option I can think of is to run linux in a virtual machine (I checked and VirtualBox seems to have a port for ipads). Here you run linux on top of iOS in an app such as VirtualBox. The downside is when in emulating software such as VirtualBox things run more slowly, because it has to emulate the environment. Also, it will only grant access to linux application and its own filesystem; interacting directly with files and apps under iOS is not what it is intended to do. The upside is that you can keep using you ipad in the normal way and switch to linux whenever you want (with a graphical user interface if you like).<br /><br />Hope you are having a great weekend :),<br />Bennie</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="2721" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="2721" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Sat 13-Mar-2021 17:04</div><div class="forum2">I forgot to mention some resources if you are interested:<br /><br />To get a kind of overview how graphics work under linux have a look at the graphics server (note that Xorg is not the only player in town anymore. Wayland is a newly developed display server):<br />https://en.wikipedia.org/wiki/X.Org_Server<br /><br />If you want to go down the rabbit hole: <br />- Bovets 'Understanding the linux kernel' is an indepth look into how the kernel works. <br />- A more specific look at the role and code of a tty driver is Coberts 'Linux Device Drivers' (chapter 18 is devoted to tty drivers)<br /><br />Another tip is looking at the source code of the mentioned 'st' terminal (https://st.suckless.org/). It is thé terminal with the least bloat and easiest to understand code in my opinion (take for example x.c where xlib is included, the interface to the X server to make 'draw' requests).</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="2722" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="2722" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Fri 2-Apr-2021 00:31</div><div class="forum2">I wonder when I'm in bash and erasing text with backspace what stops me from erasing the bash prompt at the beginning of the line?</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="2751" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="2751" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Tue 6-Apr-2021 18:43</div><div class="forum2">Thank you very much, Bennie, for all the additional information! ll check out those additional resources you recommended.<br /><br />Have a good week.<br /><br />Sincerely,<br />Mike</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="2754" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="2754" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Sun 18-Apr-2021 12:11</div><div class="forum2">Anytime Mike :)<br /><br /><div class="forumquote">I wonder when I'm in bash and erasing text with backspace what stops me from erasing the bash prompt at the beginning of the line?</div><br />Eventhough it is a bit more complex (because bash works with a builtin readline library that handles backspaces) it basically boils down to this: the prompt is a simple string that gets printed before reading in your input. If for example you'd run in bash:<br /><br /> while true:<br /> printf &quot;my prompt $ &quot;<br /> read<br /> done<br /><br />you'd get the same situation. I guess you would not expect the 'read' command to erase the printf output string. In other words: the prompt is not part of the input buffer but a simple string that gets printed before each read call.<br /><br />Bennie</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="2769" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="2769" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Tue 20-Jul-2021 20:18</div><div class="forum2">Why aren't UART driver in the graph for typical desktop system? From the article, it seems only the hardware of Terminal and UART are gone. UART setting still exists in later parts of the article.</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="2811" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="2811" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1"><b>ben</b><br />Ben in Seattle<br />Mon 2-Aug-2021 03:49</div><div class="forum2"><div class="forumquote">I wonder when I'm in bash and erasing text with backspace what stops me from erasing the bash prompt at the beginning of the line?</div><br />That's an excellent question!<br /><br />Modern terminals only show what they receive, not what they send. When you hit a key, the terminal sends it to your UNIX box which then interprets it and (usually) sends it back. The illusion that what you type immediately shows up on the terminal is due to your shell choosing to echo back the keys you've hit. The backspace character (^H) is echoed back just like any other key by your shell until there is nothing left to erase except the prompt. At that point the shell simply chooses to not echo the backspace, thus keeping the prompt intact. Some shells even choose to send a different character, ^G, which rings the bell on the terminal to let you know you've hit the end.</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="2813" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="2813" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1"><b>ben</b><br />Ben in Seattle<br />Mon 2-Aug-2021 04:18</div><div class="forum2"><div class="forumquote">Great article.<br />For another great source on TTY devices you can go to:<br />http://publib.boulder.ibm.com/infocenter/aix/v6r1/index.jsp?topic=/com.ibm.aix.genprogc/doc/genprogc/ttysys.htm<br /><br />Enjoy,<br />Ori</div><br />That site has been revamped and IBM only offers the manuals in PDF format. You can now (2021) find the TTY Subsystem for AIX documentation here: <br /><br />http://public.dhe.ibm.com/systems/power/docs/aix/61/genprogc_pdf.pdf#TTYSYS</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="2814" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="2814" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Tue 17-Aug-2021 19:49</div><div class="forum2"><div class="forumquote">So as a convenience, the operating system provides an editing buffer and some rudimentary editing commands (backspace, erase word, clear line, reprint) </div><br />Can anybody supply examples of how these listed commands may be applied to an incoming command? When can the machine decide to deprive the command of all word (i.e. erase it from the command)?</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="2816" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="2816" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Thu 23-Dec-2021 18:58</div><div class="forum2">Marvelous article. Big thanks for that. I use the pipes for decades but never understood it down to the ground of the kernel, not better until now... good idea to start at the beginning with the teletypers ;)</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="2838" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="2838" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Tue 4-Jan-2022 03:11</div><div class="forum2"><div class="forumquote"><div class="forumquote">So as a convenience, the operating system provides an editing buffer and some rudimentary editing commands (backspace, erase word, clear line, reprint) </div><br />Can anybody supply examples of how these listed commands may be applied to an incoming command? When can the machine decide to deprive the command of all word (i.e. erase it from the command)?</div><br />I don't think the buffer allows one to erase a word from a command that has been sent.<br />An example of how the buffer works is when you're typing a command in a console and, before hitting enter, decide to delete some characters to fix a typo.</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="2844" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="2844" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Tue 1-Feb-2022 17:50</div><div class="forum2">hello</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="2849" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="2849" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Thu 21-Apr-2022 19:15</div><div class="forum2">Great article!</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="2863" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="2863" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Mon 25-Apr-2022 07:55</div><div class="forum2">Fantastic stuff!!<br /><br />Thank you for writing it.</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="2867" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="2867" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Wed 27-Apr-2022 15:57</div><div class="forum2">This is by far the best tty article to be found on the web. Thanks!</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="2869" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="2869" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Sun 29-May-2022 19:26</div><div class="forum2">Thanks for a great article. We need a lft-o-pedia for purely technical stuf :)</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="2874" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="2874" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Thu 9-Jun-2022 13:36</div><div class="forum2"><div class="forumquote">Anytime Mike :)<br /><br /><div class="forumquote">I wonder when I'm in bash and erasing text with backspace what stops me from erasing the bash prompt at the beginning of the line?</div><br />Eventhough it is a bit more complex (because bash works with a builtin readline library that handles backspaces) it basically boils down to this: the prompt is a simple string that gets printed before reading in your input. If for example you'd run in bash:<br /><br /> while true:<br /> printf &quot;my prompt $ &quot;<br /> read<br /> done<br /><br />you'd get the same situation. I guess you would not expect the 'read' command to erase the printf output string. In other words: the prompt is not part of the input buffer but a simple string that gets printed before each read call.<br /><br />Bennie</div></div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="2881" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="2881" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Fri 1-Jul-2022 22:07</div><div class="forum2">Thanks a lot those explanations are really helpful and as clear as they can possibly be. The topic itself is quite special: As soon as you use a terminal and a shell, you will encounter all these things if you want it or not. You can simply let them happen and rely on the fact that everything just works … somehow. But with the help of this article, you can actually understand whats going on behind the scenes. Great!</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="2884" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="2884" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Fri 8-Jul-2022 08:01</div><div class="forum2"><div class="forumquote">I have been trying to chew through documents in every unix book possible to explain how the TTY system really works. Your article has been more informative than all of these books. Without a programmers knowledge of how a unix kernel works, it's quite difficult for a System Administrator to understand concepts that are so crucial to their jobs. Thank you for your writing such a great article. Your help is truly appreciated.</div></div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="2885" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="2885" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Tue 2-Aug-2022 07:54</div><div class="forum2">I'd just like to point out another awesome article about &quot;What happens when you press a key in your terminal?&quot; by Julia Evans (b0rk)<br />https://jvns.ca/blog/2022/07/20/pseudoterminals/<br /><br />kind regards<br />-mrizvic</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="2890" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="2890" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Mon 10-Oct-2022 15:28</div><div class="forum2">Thank you for your explanation! <br /><br />linrl3</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="2905" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="2905" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Wed 4-Jan-2023 08:26</div><div class="forum2">Thanks for the explanation, this can become a book because it's so needed!</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="2977" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="2977" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Sun 5-Feb-2023 14:47</div><div class="forum2">Excellent article. Cheers!<br /><br />- Stefano I.</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="2988" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="2988" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Tue 7-Mar-2023 14:49</div><div class="forum2">I came here through http://www.rkoucha.fr/tech_corner/pty_pdip.html<br />Both excellent contents, and this page is running since 2008!!!<br /><br />Congratulations</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="2999" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="2999" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Sun 19-Mar-2023 13:49</div><div class="forum2">Linus, <br /><br />Thank you for writing such an informative article. All the best!<br /><br />-Lane F.</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="3001" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="3001" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Sat 29-Jul-2023 23:47</div><div class="forum2">Extremely good info, I can't thank you enough! I've only recently begun to get serious about learning how to use Linux/BSD and for months I've played this weird game of learning how about shells, editors, shell languages and kernel specifics. Each google search left digging in a new area but nothing tied it all together - until I read this!! Please write a book someday, you are incredibly good at explaining arcane topics and putting the pieces into perspective.</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="3046" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="3046" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<div class="forum0"><div class="forum1">Anonymous<br />Fri 26-Jan-2024 07:24</div><div class="forum2">Coming from 2024, great article!!</div><div class="forumpostbuttons"><div class="forumpostbutton"><form action="/forum/report.php" method="post"><div><input type="hidden" name="id" value="3099" /><input type="hidden" name="swe" value="f" /><input type="submit" class="fbutton" name="quote" value="Report abuse" /></div></form></div><div class="forumpostbutton"><form action="/forum/write.php" method="post"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="hidden" name="import" value="3099" /><input type="submit" class="fbutton" name="quote" value="Quote &amp; reply" /></div></form></div></div></div>
<form method="get" action="/forum/write.php"><div><input type="hidden" name="pk" value="1" /><input type="hidden" name="pg" value="63" /><input type="submit" class="button" value="Post a new comment" /></div></form></div>
</div></div></div></div></body></html>