I work with ZOC terminal installed at windows 7 in order to communicate with device that has Linux operating system zoc picture.
The communication via terminal works great but recently the text has been cut halfway down the page.
attached picture .
The picture shows 24 lines. You can get this behavior if your terminal description sets scrolling margins to 24 lines — as some might do, when initializing the terminal if the application assumes that the screen has 24 lines.
Since ZOC could be connecting via a serial port, that may not allow negotiations about window size (NAWS). You might then see that stty -a shows 24 lines in its output. ZOC is said to emulate a VT100; you can usually adjust its notion of screensize either directory (using stty) or using the resize program (which calls the same system functions as stty as a side-effect).
Alt+y solved the issue I had..
Related
Would anyone know how to disable the virtual terminals in linux? I am using Yocto, Morty version on an i.MX6 processor. Even though our base distribution is Yocto, unfortunately we have diverged from building it with recipes, so this is more of a straight linux question than Yocto…
To give some detail as to my problem: It is for an embedded device that has an HDMI port - when I attach a terminal to the HDMI port it shows the Linux Penguin logo, a getty service and blanks out after 600 seconds. I just want to use the hdmi port as an output with nothing displayed on the output and I want it to stay on all the time.
I have found that the hdmi port maps to /dev/tty1 – when I type: echo “asdfasdf” > /dev/tty1 I see the characters output to the monitor.
Here are a few things I have tried to no avail – a lot of these are not needed if I can figure out how to disable it as a virtual terminal…
• I figured out how to disable the getty service but a cursor still blinks. I don’t even want a cursor to show
• I have tried to disable the display of the penguins by disabling the LOGO in the kernel config parameters - I commented anything with LOGO out:
CONFIG_LOGO=y
CONFIG_LOGO_LINUX_MONO=y
CONFIG_LOGO_LINUX_VGA16=y
CONFIG_LOGO_LINUX_CLUT224=y
To no avail. The logo still shows : .
• The fact that it blanks after 600 seconds is console blanking – I can see it set to 600 in the file: /sys/module/kernel/parameters/consoleblank. When I issue the command: echo -e '\033[9;0]'>/dev/tty1
It sets the console blanking to 0 and wakes the terminal. Being able to wake the console up is limited success but I would like to disable the virtual terminal altogether…
• I tried commenting out any virtual terminal defines in the config file to no avail:
CONFIG_VT=y
CONFIG_VT_CONSOLE=y
CONFIG_VT_CONSOLE_SLEEP=y
CONFIG_HW_CONSOLE=y
CONFIG_VT_HW_CONSOLE_BINDING=y
Everything I have read suggests that /dev/tty1 is a virtual terminal or console. From what I read about the VT option, disabling the CONFIG_VT should do it:
VT — Virtual terminal Say yes here to get support for terminal devices
with display and keyboard devices. These are called "virtual" because
you can run several virtual terminals (also called virtual consoles)
on one physical terminal. You need at least one virtual terminal
device in order to make use of your keyboard and monitor. Therefore,
only people configuring an embedded system would want to say no here
in order to save some memory; the only way to log into such a system
is then via a serial or network connection. Virtual terminals are
useful because, for example, one virtual terminal can display system
messages and warnings, another one can be used for a text-mode user
session, and a third could run an X session, all in parallel.
Switching between virtual terminals is done with certain key
combinations, usually Alt-function key. If you are unsure, say yes, or
else you won't be able to do much with your Linux system.
But for some reason it doesn’t do anything!
• I found this thread; https://askubuntu.com/questions/357039/how-do-i-disable-virtual-consoles-tty1-6 among others, but none are much help since my distribution does not have any of the directories in the solutions offered in this thread or any others I have found. For instance I do not have a /etc/events.d nor do I have a /etc/default/console-setup file nor do I have a /etc/init directory… I imagine the reason for this is that my distribution uses systemd and the solutions are SysV based init maybe?
Disabling the logo or console blanking would not be necessary if I could just figure out how to disable that port as a terminal…
So does anyone have pointers or things I could try? I am relatively new (returning after 10 years - I worked with DNX 10 years ago v2.6 and it seems everything I knew about init is fairly obsolete lol) to linux so I am sure I am missing a lot…
Thanks,
- Chuck
I think I found the answer to my question. This is actually a frame buffer console documented here: Documentation/fb/fbcon.txt. From the documentation:
The framebuffer console (fbcon), as its name implies, is a text
console running on top of the framebuffer device. It has the
functionality of any standard text console driver, such as the VGA
console, with the added features that can be attributed to the
graphical nature of the framebuffer.
Commenting out the line
CONFIG_FRAMEBUFFER_CONSOLE=y
In the configuration file located in /arch/arm/configs will disable it.
Also this part of the documentation shows you how to disable it at runtime:
So, how do we unbind fbcon from the console? Part of the answer is in
Documentation/console/console.txt. To summarize:
Echo a value to the bind file that represents the framebuffer console
driver. So assuming vtcon1 represents fbcon, then:
echo 1 > sys/class/vtconsole/vtcon1/bind - attach framebuffer console
to
console layer echo 0 > sys/class/vtconsole/vtcon1/bind - detach framebuffer console from
console layer
When I issue the echo 0 command, the cursor stops blinking and starts blinking again when I issue the echo 1 command.
I think there is another way of doing it as well by modifying the Yocto build environment by putting the USE_VT="0" in the OpenEmbedded machine config file. The "USE_VT" variable is referenced by the sysvinit-inittab recipe. This answer was given to me from the Yocto Linux mailing list - but I have not tested it since we have diverged from Yocto...
I'm working with a bunch of Raspberry Pi 2s running Raspbian, building interactive puzzles for a performance installation. The puzzles are meant to be played on the command line. My background is in web development, so while I'm very comfortable on the Linux command line, I don't have a lot of experience tailoring a local terminal environment. I have a number of distinct requirements and I can never quite fulfill all of them at once. Namely:
I would like the game to be loaded from the kernel console, without starting LXDE. This is mostly because in a terminal environment, I can catch any keystrokes that someone would use to try to exit the game, and put a password up to prevent it. Also, I have not yet determined whether I could start a terminal window in LXDE and hide all the windowing chrome to make the game appear to be CLI only.
I need 256 color display.
The game is played in English, but contains some Cyrillic characters, so I need unicode support. A sample of the characters used:
0x1440
0x1437
0x143d
I can get the 256 color display in xterm using TERM=xterm-256color, but ONLY if I launch it in a window in LXDE. Same goes for Unicode support. When I try starting xterm from the kernel console, I can pass a number of options to customize the display of the terminal (-fg, -bg, -fa), but can't make it display 256 colors or unicode characters. I've tried using a .Xresource file and loading it with xrdb -merge ~/.Xresource, but it doesn't seem to have any effect at all. Currently, I have a .xinitrc file that contains
`which xterm` \
-fg white \
-bg black \
-fa *-fixed-*-*-*-18-*
-en en_US.UTF-8
-tn xterm-256color
and I launch xterm by simply running xinit. When I do so, xterm starts and respects the foreground, background, and font properties, but only displays 8 colors and won't display unicode characters. Can anyone offer any insight for how to meet all three of my requirements above? I would also accept an answer that shows how I can simply start the game from an LXDE window, but full-screen that window with absolutely no chrome, and prevent the user from being able to exit that environement (there will not be a mouse attached to the machine)
Thanks!
It's a shame, someone posted an answer here and pointed out that I had a typo in the .xinitrc that I posted (missing \ characters after a couple of the lines). After going back and double checking, that did turn out to be part of the problem. He or she or someone else apparently took down the answer though, so I can't give credit.
The other part of the problem was that the unicode characters I'm trying to display are not Cyrillic, but are rather part of the Unified Canadian Aboriginal Syllabics block, which simply wasn't part of any of the terminal fonts I was using. After some digging, I found what appears to be the only monospaced font that contains these characters, Everson Mono. I installed that to /usr/local/share/fonts, and amended my .xinitrc file thusly:
`which xterm` \
-fg white \
-bg black \
-fa 'Everson Mono' \
-en en_US.UTF-8 \
-tn xterm-256color
...and now I can load xterm with xinit and run my app and all is right with the world.
I want to know if anyone does know a way to dump or copy the whole lot of viewable messages in a xterm window on linux. The very important thing is I don't want to know how to send a command out and kapture its output for stream 1 and 2 as well as the input, as this is well known to me.
I may explain for what this is needed. You do something and expect not any complications but than you got pages of msg's als err msg or normal output. To be able to see later after it you should be able to get them in a file and as long as you are able to scroll that all back and forther with your mouse it is sure the data is there some where. But the time may be not to scroll and screenshot and scroll ....
I would be glad to help me out in such cases and it would be fine to have the full view including all your own typing and all the msg's in same order as you watch it when you scroll it back.
I don't really know where this is stored and how you could get that saved. I know that I could dump the whole lot of Memory and search it for a part of the xterm window, but that is a bit over the top I think.
There is a control sequence, which I had forgotten. This question reminded me. In XTerm Control Sequences, it is noted "print all pages":
CSI ? Pm i
Media Copy (MC, DEC-specific).
Ps = 1 -> Print line containing cursor.
Ps = 4 -> Turn off autoprint mode.
Ps = 5 -> Turn on autoprint mode.
Ps = 1 0 -> Print composed display, ignores DECPEX.
Ps = 1 1 -> Print all pages.
That dates from 1999 (patch #119), so you likely have it in your xterm. You could do this in a shell command like this:
printf '\033[?11i'
A comment mentions the page Hidden gems of xterm, which uses the corresponding action print-everything (something that can be executed via the translations resource). It is in the manual page, of course. The same comment points to Extra characters in XTerm printerCommand output, which mentions the resource printAttributes. By default, the control sequences for the printer tell xterm to send extra control characters (to reconstruct video attributes). The resource can be modified (set to 0) to suppress that. That is even older (patch #74).
Without that — Conceivably one could construct an application which used the X SendEvent protocol to construct a series of events which would be interpreted as xterm actions to scroll back, select text and copy it chunk-by-chunk via the clipboard. You could even write it in Perl (there is a module for X protocol). But seriously, no.
If you want to capture text which was written to xterm, you can do this by preparing before the text is needed by different methods (see manual):
turn on the xterm logging feature (not that user-friendly because it generates the filename). This can be enabled using the "Log to File (logging)" menu entry.
use the printer control sequences to write lines as they are written (again, not that friendly, though there is a menu entry to turn it on and off, "Redirect to Printer (print-redir)")
use script to capture all output to the terminal. I use this, because it works with any terminal on any POSIX-like system (even Cygwin).
Each of these methods produces a file containing escape/control sequences, which requires filtering out. The hypothetical program using SendEvent could in principle eliminate that.
There are multiple questions that ask about capturing keystrokes, but the solutions provided have some complications.
ncurses termios structure/stty
-Changes the console settings so that SIGSTOP/SIGTERM would leave the setting in effect for the terminal.
X based solutions
-requires X server to be running(not that is is a huge problem, but it seems unnecessary to bring X server calls into a console application)
/dev/input/event*
-requires root
Vim seems to be able to capture keystrokes without root, an X server, and without changing the console settings. Does anyone know how vim is able to achieve this in linux?
Look at TTY raw mode -- there is a ioctl call which allows you to get individual keystrokes -- i.e. taking the tty out of line mode which is the default.
A quick search on ioctl raw give this link which looks ok.
I'm currently setting up a node.js server and I'm using the debug module here https://github.com/visionmedia/debug.
I'm trying to enable it so I can get the colored debugging information in my output, however my terminal looks like the last terminal screen at the bottom after it says:
When stdout is not a TTY, Date#toUTCString() is used, making it more useful for logging the debug information as shown below:
Can anyone shed some light on this? Thanks.
tty is one of those funky Unix commands that prints (or, displays) to standard output the name of the terminal connected to standard input.
These are commonly used as a way to get access to the computer to fix things, without actually logging into a possibly b0rked desktop.
Related: What is tty7 in the commandline?
By default Ubuntu has 7 tty's.
1-6 are command line only, 7 runs your X session (your normal desktop).
To access them, use this keyboard shortcut:
Ctrl + Alt + F1
(changing F1 to F1-F6 to access the terminal that you need)
To get back to your X session (the normal desktop),
Ctrl + Alt + F7
The TTY is the terminal or command prompt itself.
The screenshots are demonstrating the different results when stdout is directed to the terminal/TTY (with colors and time diffs) vs. when it's redirected elsewhere, such as to a file (via > out and with timestamps).
It determines which format to use with tty.isatty.
Note that not all terminals support the ANSI escape codes it's using to display colors.