Menu
  • HOME
  • TAGS

bash prompt shell displayed differently in terminal and tty console

bash,terminal,console,tty,ps1

You have \\[\\e]0; \\[email protected]\\h: \\w\\a\\] and \\[email protected]\\h:\\w\\$ in PS1. The question is why is your terminal not showing that first set but your console is. The answer, I believe, is that you have that first set enclosed in a \[...\] block which indicates that it is non-printing and takes up...

How to change font tty.js?

node.js,osx,fonts,tty

It's just a web app, so it seems like changing the font in the CSS would do the trick.

Common commands to show up on startup of Terminal (OSX)?

osx,terminal,tty

Any text in the file /etc/motd will be displayed when you open a new terminal. You will need to edit this file using sudo, eg $ sudo vi /etc/motd ...

socat: log conversation with serial port

bash,tty,socat

(my first approach was not correct, so I modify) I have never used socat, but if it has -v log.txt option I have a possible solution for you as I see with -v option it prints the result also to stderr. I assume You want to have the log file...

how to refresh entire screen in putty

remote-access,redhat,putty,tty

If your terminal supports an alternate screen buffer, it should have rmcup and smcup define in its terminfo entry % infocmp | grep -e rmcup -e smcup ri=\EM, rmacs=^O, rmcup=\E[2J\E[?47l\E8, rmir=\E[4l, smcup=\E7\E[?47h, smir=\E[4h, smkx=\E[?1h\E=, smso=\E[7m, If enabling altscreen in your .screenrc doesn't fix it, try adding these 2 lines to...

Check if default output goes to a terminal in R

r,terminal,tty

You may use isatty() on a R connection, just like you would use it in libc on a file descriptor: R> isatty(stdout()) [1] TRUE ...

how to open /dev/console in C

c,tty

The actual available devices for a tty depend on the system. On most interactive Unix/Unix-like systems you will have a "tty" whose name can be found from the command-line program tty. For example: $ tty /dev/pts/2 Likely, you also have a device named "tty", e.g., $ ls -l /dev/tty lrwxrwxrwx...

Raspbian echo device

echo,raspbian,tty

Raspbian sure supports such behaviour: [email protected]:/root# mkfifo /dev/tty100 [email protected]:/root# cat < /dev/tty100 |cat > /dev/tty100& [1] 19024 root[email protected]:/root# echo hi > /dev/tty100 [email protected]:/root# cat /dev/tty100 hi ^C ...

Get both console and tty after upgrade Debian to Jessie 8.0 in openvz

console,debian,tty,openvz,proxmox

I just fix this by removing: /etc/systemd/system/getty.target.wants/[email protected] and it now tty1 is gone. Still don't know if it will breaks anything....

AWK pipe output from TTY to PHP

php,linux,bash,debian,tty

awk is buffering your data. Use fflush() to flush the buffers after each output line: awk '{ print $0 > "/dev/stderr"; if (/^Cycle/) { print "update kWh.rrd N:" $5; fflush(); } }' < /dev/ttyUSB0 | php5 test.php Also make sure that /dev/ttyUSB0 actually outputs a line (terminated by \n), and...

egrep to list devices in /dev directory

grep,ubuntu-12.04,tty

Change the pattern to the following: devices = ["/dev/" + x for x in os.popen("ls /dev/ | egrep -i 'ttyUSB|ttyS[01]$'").read().strip().split('\n')] ...

How can I send terminal escape sequences through SSH with Go?

bash,ssh,go,tty

Disable ECHOCTL terminal mode. modes := ssh.TerminalModes{ ssh.ECHO: 0, ssh.ECHOCTL: 0, ssh.TTY_OP_ISPEED: 14400, ssh.TTY_OP_OSPEED: 14400 } ...

Purpose of master and slave pty and forking process

linux,unix,terminal,tty,pty

Here are some related well explained articles. PTY and TTY and The TTY demystified. Have a look....

Pyserial: weird permission denied

python,permission-denied,pyserial,tty

Continuously trying to open the port finally succeeds after a while actually. So hiding the errors makes it work for the moment: while(1): port = get_serial_port() if port: print('Will open port %s' % port) try: ser = serial.Serial(port, 9600) print(ser.readline()) except: pass This ofcourse is just a hack. The behaviour...

sudoers NOPASSWD: sudo: no tty present and no askpass program specified

linux,bash,user,sudo,tty

sudo permissions are about the user/group you are changing from not the user you are changing to. So are those permission lines are letting the testuser user and the testgroup group run any command (as anyone) without a password. You need to give permission to the user running the script...

What mechanism allows ViM to temporarily overwrite the entire console?

vim,ncurses,tty

Most terminal emulators are able to save and restore the contents of the screen. The terminfo codes for this are smcup to enter full-screen mode and rmcup to leave it. (The older termcap codes are ti and te.) If these capabilities are enabled in the terminfo database, any program that...

How to output to the currently visible terminal

c++,c,linux,tty

The comment of @BoBTFish is working. A possible pseudo C++ implementation: // somewhere in code: std::memset(&sa, 0, sizeof(struct sigaction)); sa.sa_sigaction = sh_dump; sa.sa_flags = static_cast<int>(SA_SIGINFO); // <- important, else you'll get an invalid siginfo_t pointer sigaction(SIGUSR1, &sa, NULL); void sh_dump(int, siginfo_t *info, void *) { if(info) { // do some...

What is the difference between setpgrp and tcsetpgrp

c,linux,unix,libc,tty

tcsetprgrp is a function that is used for set the process group based on the file descriptor which is connected to terminal. If the file descriptor not connected to the terminal that time it will give the error. setpgrp is used for making the calling process as a process group...

Python SSH via Pseudo TTY Clear

python,ssh,tty,pty

I think your problem is deeper than you realize. Luckily, it's also easier to solve than you realize. What you seem to want is for os.read to return the entirety of what the shell has to send to you in one call. That's not something you can ask for. Depending...

Filter out command that needs a terminal in Python subprocess module

python,terminal,subprocess,tty

What you expect is a function that receives command as input, and returns meaningful output by running the command. Since the command is arbitrary, requirement for tty is just one of many bad cases may happen (other includes running a infinite loop), your function should only concern about its running...

Read serial (/dev/tty*) fom java

java,linux,serial-port,tty

The problem is that Byte is just too narrow for this data serial data(because it is signed), so I do loose most significant bit. Solution is to read everything to int.

Disable DSUSP in Python

python,osx,tty,fcntl,termios

I am unable to check the actual behaviour for this as I do not have any computers with an operating system that would have the DSUSP behaviour. However while investigating the issue, I came across issue 7695 in Python bug tracker. It seems that the VDSUSP is available in termios...

C serial program using keyboard and monitor instead of serial port /dev/ttyUSBX

c,linux,serial-port,tty

UNIX/Linux sets up stdin (fd 0), stdout (fd 1) and stderr (fd 2) already open to the terminal (whether serial line with real hardware terminal, virtual console or graphics terminal) your keyboard and screen are connected to. It's available for termio control and as a special device filename /dev/tty the...

bash: what to do when stdout does not exist

linux,bash,ssh,stdout,tty

The following command does what you want: ssh -t [email protected] 'nohup ~/test.sh foo > nohup.out 2>&1 & p1=$!; tail -f ~/nohup.out & wait $p1' ... test.sh is located in the users home directory Explanation: 1.) "ssh -t [email protected] " ... pretty clear ... starts remote session 2.) "nohup ~/test.sh foo...

What does the function ttyn(3) return?

tty,c

At that point in time, a typewriter (or teletype, or tty) was an RS-232 terminal connected to the computer via a serial port. The device entries in /dev corresponding to these ports were named /dev/tty0, /dev/tty1, /dev/ttya, etc. Each of those files was a character special file, as opposed to...

Process that toggles other's permission to write to your terminal [Unix] [C]

c,unix,terminal,tty

You probably meant to do perms |= S_IWOTH; rather than perms &= S_IWOTH; &'ing with S_IWOTH will clear all bits that aren't S_IWOTH, and will leave that bit as zero too if it wasn't already set. You can run tty(1) to get the filename of your terminal and run ls...

How to hijack the input stream of tty1 in a ssh session?

linux,ssh,tty

The easiest thing to do here is open up another shell and have it's output redirected into your tty1 stdout stream. script is an excellent program for capturing output of a program to a file. For example, you could do: script -t0 /dev/tty1 bash The -t parameter makes script flush...

Why can't I open/write from a serial port on Android?

android,serial-port,file-permissions,android-4.4-kitkat,tty

The issue turned out to be with SELinux, which most of the Samsung line of devices use as a security enforcement policy. That security policy was set to enforcing, such that no apps could access files outside of their designated app space, such as the serial port I was trying...

STM32F0-Discovery: no tty

linux,stm32,tty,usbserial,usart

The device gets discovered and it's a ST-Link debug interface. The STM32F0308-Discovery does not have a USB UART interface and the ST-Link does not include UART functionality as far as I can see. What you are trying to do appears to be impossible without extra hardware. You would have to...