tty

Why is terminfo[kcuu1] = '\\EOA'?

老子叫甜甜 提交于 2019-12-02 02:23:56
From what I can tell reading terminfo(5) , kcuu1 should be the sequence that the terminal sends when the up arrow is pressed. I have never, ever seen that be anything other than ^[[A (speaking now about cat , messed up terminal settings, etc). So, given that the terminals I've used (rxvt, gnome-terminal, iTerm) all default to TERM=xterm, why isn't kcuu1 \E[A ? I see that cuu1 is \E[A , but (from the man page, again), that's the string that I should send to the terminal to move the cursor, not a string the terminal sends to me. BTW this is with OS X. melpomene Arrow and other special keys

Can't change terminal size on pty/N (works on ttyN)

独自空忆成欢 提交于 2019-12-01 23:20:26
问题 I use the next to change terminal size: rc = ioctl(fd, TIOCSWINSZ, &ws); When I run this under linux text terminal (switching by Alt-Ctrl-F1), the result is that I expect to see. The whole my input and output within ranges given by ioctl syscall. But when I connect to localhost by SSH, and run the same program, it works only partly. I mean that I can't input command wider than terminal size set by ioctl, but the output can cross the borders of terminal given by ioctl, and input can take more

What mechanism allows ViM to temporarily overwrite the entire console?

点点圈 提交于 2019-12-01 16:05:06
When you enter vim , it "clears" the screen. Upon exiting, it "restores" the original contents. I understand one can use \x1b[2J to clear the console and reset the cursor position, but this will overwrite terminal contents. I assume Vim uses ncurses under the hood, in which case I suppose the better question is how ncurses does this, but how is it done? 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

Unable to create superuser in django due to not working in TTY

淺唱寂寞╮ 提交于 2019-12-01 15:10:43
问题 I go through first django tutorial from djangoproject.com and at the very beginning of part 2, which is creating superuser when I run "python manage.py createsuperuser" I get the following message back: Superuser creation skipped due to not running in a TTY. You can run `manage.py createsuperuser` in your project to create one manually. I get the same message when I go on to create superuser after running syncdb . I am working on Eclipse for Windows 7, and Django 1.7.1 together with Python 2

What mechanism allows ViM to temporarily overwrite the entire console?

爷,独闯天下 提交于 2019-12-01 14:43:53
问题 When you enter vim, it "clears" the screen. Upon exiting, it "restores" the original contents. I understand one can use \x1b[2J to clear the console and reset the cursor position, but this will overwrite terminal contents. I assume Vim uses ncurses under the hood, in which case I suppose the better question is how ncurses does this, but how is it done? 回答1: Most terminal emulators are able to save and restore the contents of the screen. The terminfo codes for this are smcup to enter full

Can I run jshell inside Unix expect?

久未见 提交于 2019-12-01 11:15:59
I'd like to redirect jshell input using expect, so that I can simulate typing in recorded demonstrations. But although I can spawn a jshell process from an expect script, which can also recognise the jshell prompt, after that nothing works. expect outputs what looks like a control sequence, like ^[[24;9R , and I don't see any output from jshell. Different terminal types produce different character sequences, but none of them work. This behaviour is consistent between expect on Ubuntu and Mac OS. Any suggestions for how to investigate this problem would be welcome. expect -d doesn't help. Here

Can I run jshell inside Unix expect?

限于喜欢 提交于 2019-12-01 09:18:27
问题 I'd like to redirect jshell input using expect, so that I can simulate typing in recorded demonstrations. But although I can spawn a jshell process from an expect script, which can also recognise the jshell prompt, after that nothing works. expect outputs what looks like a control sequence, like ^[[24;9R , and I don't see any output from jshell. Different terminal types produce different character sequences, but none of them work. This behaviour is consistent between expect on Ubuntu and Mac

persistent local tty session with java

谁说胖子不能爱 提交于 2019-12-01 05:58:01
I`m developing a web shell client, with tab functionality "code completion" and a have a question. Anyone know a way to open a local tty persistent connection where I can to execute multiple commands with one session, i wont like to exec all time Runtime.getRuntime().exec("command"); Any suggestion? Regards Instead of Runtime.getRuntime().exec("command"); do Runtime.getRuntime().exec("/bin/sh"); and hold on to the Process object. Then you can write commands to the OutputStream provided by its getOutputStream() method - I presume you're already getting the output by reading its InputStream. 来源:

How to run command during Docker build which requires a tty?

蓝咒 提交于 2019-12-01 04:34:53
I have some script I need to run during a Docker build which requires a tty (which Docker does not provide during a build). Under the hood the script uses the read command. With a tty, I can do things like (echo yes; echo no) | myscript.sh . Without it I get strange errors I don't completely understand. So is there any way to use this script during the build (given that its not mine to modify?) EDIT: Here's a more definite example of the error: FROM ubuntu:14.04 RUN echo yes | read which fails with: Step 0 : FROM ubuntu:14.04 ---> 826544226fdc Step 1 : RUN echo yes | read ---> Running in

persistent local tty session with java

时光毁灭记忆、已成空白 提交于 2019-12-01 03:55:18
问题 I`m developing a web shell client, with tab functionality "code completion" and a have a question. Anyone know a way to open a local tty persistent connection where I can to execute multiple commands with one session, i wont like to exec all time Runtime.getRuntime().exec("command"); Any suggestion? Regards 回答1: Instead of Runtime.getRuntime().exec("command"); do Runtime.getRuntime().exec("/bin/sh"); and hold on to the Process object. Then you can write commands to the OutputStream provided