pty

Ruby on Linux PTY goes away without EOF, raises Errno::EIO

旧街凉风 提交于 2019-11-30 11:48:40
I'm writing some code which takes a file, passes that file to one of several binaries for processing, and monitors the conversion process for errors. I've written and tested the following routine on OSX but linux fails for reasons about which I'm not clear. #run the command, capture the output so it doesn't display PTY.spawn(command) {|r,w,pid| until r.eof? do ##mark puts r.readline end } The command that runs varies quite a lot and the code at the ##mark has been simplified into a local echo in an attempt to debug the problem. The command executes and the script prints the expected output in

node-gyp error while doing npm install

拥有回忆 提交于 2019-11-30 08:54:36
I am doing npm install from a project and I am getting this wierd error in node-gyp. > pty.js@0.2.3 install /home/charizard/Open/terminal-codelearn/node_modules/pty.js > node-gyp rebuild npm http GET https://registry.npmjs.org/commander npm http GET https://registry.npmjs.org/nan npm http GET https://registry.npmjs.org/tinycolor npm http GET https://registry.npmjs.org/options gyp ERR! configure error gyp ERR! stack Error: "pre" versions of node cannot be installed, use the --nodedir flag instead gyp ERR! stack at install (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/install.js:65

Python + SSH Password auth (no external libraries or public/private keys)?

给你一囗甜甜゛ 提交于 2019-11-29 13:04:45
So I'm aware that you can use Pexpect to solve the issue but i'd like to not rely on additional libraries to solve the issue other than those supplied with Python3. I'm also aware the generating public keys and allowing them on the remote host is ideal, but that's sort of what i intend to use this script for (setting up keys in the right place etc). This is as far as I've gotten on "my own" with a bunch of help from the SO community. I'm sort stuck checking if the forked child pseudo terminal is done executing what it's supposed to or not. Meaning i can tell if the SSH is done executing or not

How can I detect when someone opens the slave side of a pty (pseudo-terminal) in Linux?

旧时模样 提交于 2019-11-28 08:36:57
Having more than one process read from a serial device (/dev/ttyXX) makes it so that both processes can't get all of the data -- the data will be split between them in some way. I'd like to write a program that reads from a serial device, creates several master/slave pty pairs, and then allows programs that were made to read from the serial device to instead read from the ptys so that all reading processes receive the data from the serial device and have the ptys act like the serial device in the sense that when they start reading from the pty they get only the most recent data. In other words

How to fix request failed on channel 0

删除回忆录丶 提交于 2019-11-28 04:49:15
when i want to connect to my server like this ssh -a username@my-server.de -p 22 it gives me two error messages: PTY allocation request failed on channel 0 shell request failed on channel 0 when i use the Parameter -T the first error message goes away. But how to fix the second one? I can't connect. To other server i can connect without any problems. i'm on MAC OS 10.9 The Parameter -v shows me this debug output: OpenSSH_6.2p2, OSSLShim 0.9.8r 8 Dec 2011 debug1: Reading configuration data /etc/ssh_config debug1: /etc/ssh_config line 20: Applying options for * debug1: Connecting to xxx.your

python pty.fork - how does it work

安稳与你 提交于 2019-11-27 18:15:48
问题 http://docs.python.org/library/pty.html says - pty.fork()¶ Fork. Connect the child’s controlling terminal to a pseudo-terminal. Return value is (pid, fd). Note that the child gets pid 0, and the fd is invalid. The parent’s return value is the pid of the child, and fd is a file descriptor connected to the child’s controlling terminal (and also to the child’s standard input and output). What's does this mean ? Every process has 3 fd (stdin,stdout,stderr). Does this affects these fds now ? will

Confused about Docker -t option to Allocate a pseudo-TTY

梦想的初衷 提交于 2019-11-27 16:47:33
What exactly does this option do? I've been reading a lot on TTY and am still confused. I played around with not having the -t and just -i and it seems like programs that expect user input throw an error without the -t . Why is it important for pseudo-TTY to be enabled? The "-t" option goes to how Unix/Linux handles terminal access. In the past, a terminal was a hardline connection, later a modem based connection. These had physical device drivers (they were real pieces of equipment). Once generalized networks came into use, a pseudo-terminal driver was developed. This is because it creates a

How to use pseudo-terminals in Linux with C?

怎甘沉沦 提交于 2019-11-27 15:31:08
I'm trying to figure out how to use pseudo-terminal's in linux, essentially I want to create a telnetd clone, something I mentioned in an earlier question . I understand the concept of master and slave terminal, and I have a basic grasp on how to use syscalls in C. My question concerns the next step after opening a slave / master file descriptor. How to I launch getty in the slave? Are there any good resources on the net for using the forkpty(), openpty(),or another API? Some examples in C would help. This was a very similar question , but no one really provided any examples. Advanced

How to fix request failed on channel 0

依然范特西╮ 提交于 2019-11-27 05:23:11
问题 when i want to connect to my server like this ssh -a username@my-server.de -p 22 it gives me two error messages: PTY allocation request failed on channel 0 shell request failed on channel 0 when i use the Parameter -T the first error message goes away. But how to fix the second one? I can't connect. To other server i can connect without any problems. i'm on MAC OS 10.9 The Parameter -v shows me this debug output: OpenSSH_6.2p2, OSSLShim 0.9.8r 8 Dec 2011 debug1: Reading configuration data

What is the equivalent of unbuffer program on Windows?

前提是你 提交于 2019-11-27 04:33:32
Hi according to this post , unbuffer connects to a command via a pseudo-terminal (pty), which makes the system treat it as an interactive process, therefore not using any stdout buffering. I would like to use this function on Windows. May I know what is the equivalent of unbuffer program on Windows? Thanks. The behaviour you're describing is typical of applications using run-time libraries for I/O. By default, most runtime libraries check to see whether the handle is a character mode device such as a console, and if so, they don't do any buffering. (Ideally the run-time library would treat a