October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsSlow PC?RecommendedPC slow today? Run a repair scan before it gets worseResolve common Windows issues and optimize system performance.Scan NowOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
World desk4 min

What to Do If Another Process Writes Unwanted Text to Your Terminal

Diagnose unwanted terminal text before changing settings: background output, terminal messages, and inserted command-line characters need different responses.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

First work out whether the text is ordinary output, a message sent to your terminal, or characters being inserted into terminal input. These have different causes and fixes: on Linux, stty tostop can stop background jobs that write to the terminal, while message-permission controls such as mesg n address certain user-to-user terminal messages. Neither is a fix for characters being injected into a command line.

Identify what the terminal is doing

Watch what happens to the text before changing settings. Text that appears on screen may be output from a background job or a terminal-messaging utility. Text that appears inside the command line, where the shell may accept it as input, is a different and more serious symptom. A visual interruption alone does not establish that anyone has compromised the system.

As an Amazon Associate I earn from qualifying purchases.

  • Output: text appears in the terminal display, but is not entered as part of your command.
  • A terminal message: another user or process sends a message through a facility such as write. POSIX describes write as sending text to a recipient’s terminal.
  • Input insertion: characters appear in the terminal’s input stream or command line. On Linux, the TIOCSTI ioctl is one mechanism documented for inserting a byte into a terminal’s input queue.

If a command line is being altered, avoid pressing Enter until you have checked what is there. Do not treat a screen-only interruption as proof of input injection.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Inspect terminal settings before changing them

In the affected terminal, run:

stty -a

This reports the terminal’s current settings. POSIX specifies that stty can report terminal characteristics and that -a displays all settings. It uses the terminal connected to standard input, rather than relying on an output-only path to address a terminal device. On shared systems, do not casually run commands intended to change another user’s terminal.

#1 Best Overall
Super Mini Wired Keyboard, MCSaite Full Size 78 Keys Keypad Small Portable Fit with Professional or Industrial Use for Computer Laptop Mac Notebook
  • Super Mini Full Size USB Wired Keyboard Portable computer cable 78 - key keyboard, 1.5 meters long, and size 8.66*4.64*0.75 inches/ 220 x118x19. 2 mm
  • Wired USB Connection, convenient and easy to use, support plug and play, and is applicable to any desktop and laptop computers.
  • Small stature high grade PVC material, durable and comfortable with laser engraving keypad.
  • Comfortable buttons perfect coordination with the computer, give you a comfortable office life.
  • Mat to ensure that it is unlikely to slide the keyboard, stable operation, after the 1 million test, stable performance and perfect operation.

Stop background jobs from writing to the terminal

If the interruption is output from a background job and you want the terminal to stop those writes, try this in the affected shell:

stty tostop

On Linux, this enables the terminal’s TOSTOP behavior: background jobs that try to write to the terminal are stopped. POSIX describes the behavior as sending SIGTTOU to the background process group. That can pause a job rather than quietly discard its output, so the job may need ordinary job-control handling. This setting does not block foreground program output, deny terminal messages, or prevent input insertion.

Rank #2
SR Mini Keyboard Wired Thin Light 78 Keys USB Multimedia Small for Pc Computer Laptop
  • Compatible Devices: PC, Mac, PS3, Xbox360, Windows 8 7 XP Vista
  • Color:black
  • Multimedia composite key
  • thin and fashion
  • Character laser print

To restore the usual behavior for background output in that terminal, run:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

stty -tostop

These commands change terminal settings for the current terminal; they are not a system-wide security control. If you are unsure whether the output is from a background job, inspect the setting and observe which job is producing the text before leaving tostop enabled.

Rank #3
6P 6-Pin PS/2 PC Connector Signals Breakout Board Screw Terminals Pur Keyboard
  • 6P 6-Pin PS/2 PC Connector Signals Breakout Board Screw Terminals Pur keyboard

Deny terminal messages when that is the source

POSIX allows a user to deny permission to receive a message sent with write. On many Unix-like systems, mesg n is the conventional command for denying such messages in the current session:

mesg n

Availability, exact behavior, and permission policy vary by system; check the local mesg manual page or ask the administrator on a shared machine. This affects message-receiving permission, not arbitrary output from programs running in the terminal and not characters inserted into shell input.

Rank #4
Perixx PERIBOARD-409U Wired USB Mini Keyboard, Black, US English Layout
  • PIANO BLACK MINI KEYBOARD - Measurements: 12. 40" x 5. 79" x 0. 79" (31. 4 x 14. 6 x 2 cm)
  • CLEAR AND INDUSTRIAL DESIGN - No printed logo on the keyboard to integrate it better in our set-up
  • WIRED CONNECTION - USB interface with 5. 9 ft cable, long enough to connected to a computer above or under the desk
  • PLUG AND PLAY FEATURE - Plug your keyboard into your computer and start using it; No installation necessary
  • SYSTEM REQUIREMENTS - Windows 7, 8, and 10; Package includes: 1x PERIBOARD-409, 12-month limited

Treat inserted command-line characters as a separate problem

If text is appearing as keystrokes or being added to shell input, neither stty tostop nor mesg n addresses the underlying mechanism. Check which processes are running under your account and which processes can access the terminal device, and involve the system administrator if you do not recognize the activity.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Linux documents TIOCSTI as a way to insert a byte into a terminal’s input queue. The Linux man-pages TIOCSTI page, version 6.19 dated February 8, 2026, notes that on Linux 6.2 and later this operation may require CAP_SYS_ADMIN when dev.tty.legacy_tiocsti is false. That is a Linux-specific, configurable rule; it is not a guarantee about every Linux configuration, Unix-like system, or terminal emulator.

Best Value
Perixx PERIBOARD-409H Wired USB Mini Keyboard with 2 USB Hubs, Black, US English Layout
  • COMPACT DESIGN - Mini keyboard design without number pad area; Design that save space on your desk
  • BUILT-IN USB HUBS - 2 built-in extra USB ports on the side of the keyboard; Use them to connect extra input devices, such as connecting with your mouse, keypad and USB flash drive; Users have more flexibility at workspace
  • SOLID AND POWERFUL - Long lasting key caps that are built with high quality ABS material, are printed with durable UV coating; The responsive membrane keys offer 10.000.000 times switch life cycle
  • PLUG AND PLAY - Easy setup, require no extra driver or software to work; Simply plug it into a USB 2.0 port and start typing with 5'9 long cable, it is long enough for you to connect with your computer, whether it is on or under your desk
  • SYSTEM REQUIREMENTS - Windows 7, 8, 10. Wired USB connection. Package includes: 1 PERIBOARD-409H UK, 1 instruction manual
  • If the input may execute an unsafe command, do not submit it. Move to a fresh terminal or trusted console if practical.
  • On a shared system, ask the administrator to review processes and terminal access rather than changing device permissions yourself.
  • If a compromise seems plausible, preserve relevant details and seek help before killing processes or making changes that could obscure what happened.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Choose the control that matches the symptom

What you observe Possible source Relevant action What it does not address
Output from a background job appears in the terminal A background process writing to its controlling terminal On Linux, use stty tostop; undo it with stty -tostop. Foreground output, terminal messages, or input insertion
A message arrives through a terminal messaging facility A user or process using write or a similar facility Check local policy and syntax; mesg n is conventional on many Unix-like systems. General program output or input insertion
Unexpected characters enter a command line Potential access to terminal input; Linux documents TIOCSTI as one possible mechanism Inspect processes and terminal access; consult an administrator and system security controls. There is no general-purpose fix established here; output and message controls are not remedies

Terminal behavior depends on the operating system, kernel configuration, utilities, and whether the session is shared. A process with a controlling terminal can refer to it through /dev/tty on systems that provide that device, but the identity of the process causing a particular interruption must be determined on that system.

Quick Recap

Bestseller No. 2
SR Mini Keyboard Wired Thin Light 78 Keys USB Multimedia Small for Pc Computer Laptop
SR Mini Keyboard Wired Thin Light 78 Keys USB Multimedia Small for Pc Computer Laptop
Compatible Devices: PC, Mac, PS3, Xbox360, Windows 8 7 XP Vista; Color:black; Multimedia composite key
$13.84
Bestseller No. 3
6P 6-Pin PS/2 PC Connector Signals Breakout Board Screw Terminals Pur Keyboard
6P 6-Pin PS/2 PC Connector Signals Breakout Board Screw Terminals Pur Keyboard
6P 6-Pin PS/2 PC Connector Signals Breakout Board Screw Terminals Pur keyboard
Bestseller No. 4
Perixx PERIBOARD-409U Wired USB Mini Keyboard, Black, US English Layout
Perixx PERIBOARD-409U Wired USB Mini Keyboard, Black, US English Layout
PIANO BLACK MINI KEYBOARD - Measurements: 12. 40" x 5. 79" x 0. 79" (31. 4 x 14. 6 x 2 cm)
$15.43

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
PC Slower Than It Used to Be?Free scan - under a minute
Crashes, No Sound, or Screen Glitches?Free driver scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.