xterm

In PyQt, how can a terminal be embedded in a window?

ぐ巨炮叔叔 提交于 2019-12-23 20:01:26
问题 I have a small script that is designed to embed an xterm in a PyQt GUI. On Linux, it works, creating a GUI like this: However, running the same script on OS X yields two windows like this: Does anyone know how to address this and prevent OS X from screwing up the GUI? import sys from PyQt4.QtCore import * from PyQt4.QtGui import * class embeddedTerminal(QWidget): def __init__(self): QWidget.__init__(self) self.resize(800, 600) self.process = QProcess(self) self.terminal = QWidget(self) layout

C: setup pseudoterminal and open with xterm

邮差的信 提交于 2019-12-23 04:57:28
问题 The following simplified piece of code is executed by a thread in the background. The thread runs until he is told to exit (by user input). In the code below I have removed some error checking for better readability. Even with error checking the code works well and both the master and the slave are created and/or opened. ... int master, slave; char *slavename; char *cc; master = posix_openpt(O_RDWR); grantpt(master); unlockpt(master); slavename = ptsname(master); slave = open(slavename, O

Automating xterm using Expect

半腔热情 提交于 2019-12-22 13:05:15
问题 I am trying to automate xterm window using Expect (though I already knew Expect cant control such GUI applications, but there is a tweaked mechanism explained in Exploring Expect) package require Expect spawn -pty stty raw -echo < $spawn_out(slave,name) regexp ".*(.)(.)" $spawn_out(slave,name) dummy c1 c2 if {[string compare $c1 "/"] == 0} { set c1 "0" } set xterm_pid [exec xterm -S$c1$c2$spawn_out(slave,fd) &] close -slave expect "\n" ;# match and discard X window id set xterm $spawn_id

Can I get terminal title? (or otherwise restore old one)

半世苍凉 提交于 2019-12-22 06:48:38
问题 Setting terminal title is easy with echo -e "\e]0;some title\007" . Works with pretty much every terminal program. What I want is to set terminal title when some program starts - and restore old one when it finishes. Is this possible? 回答1: On xterm, the terminal control sequences 22 and 23 work fine, as in #!/bin/sh /bin/echo -ne '\033[22;0t' # Save title on stack /bin/echo -ne "\033]0;$(date)\007" sleep 1 /bin/echo -ne '\033[23;0t' # Restore title from stack It looks like this isn't

embedding an application (in this case a terminal) within a QT application

久未见 提交于 2019-12-21 01:25:11
问题 I am writing a QT application and I need to embed a terminal (we say,xterm) within a QDialog, like some KDE application (see kdevelop/kate/...). I've been trying with: - QX11EmbedContainer placed into the QLayout of my QDialog - QProcess for the program I want to excecute I expect the QProcess running within the QX11EmbedContainer, but it does not work. The problem is that I can't put the xterm into the QX11EmbedContainer, the only thing I obtain is an xterm window (unfortunately separated

bash command preserve color when piping [duplicate]

匆匆过客 提交于 2019-12-17 22:45:03
问题 This question already has answers here : Closed 8 years ago . Possible Duplicate: Can colorized output be captured via shell redirect? setup In this case specifically I'm trying to preserve the colors in git status -s when piping it to another command. Some git commands, diff for instance, and other commands like grep have an option --color=always but git status does not. question Is there a way to pipe or capture the output of a command and make it think it is outputting to the xterm shell

Set screen-title from shellscript

穿精又带淫゛_ 提交于 2019-12-17 22:06:36
问题 Is it possible to set the Screen Title using a shell script? I thought about something like sending the key commands ctrl + A shift - A Name enter I searched for about an hour on how to emulate keystrokes in an shell script, but didn't find the answer. 回答1: You can set the screen / xterm title using the following lines: #!/bin/bash mytitle="Some title" echo -e '\033k'$mytitle'\033\\' [UPDATE] - by request I'm also including the solution proposed by @Espo below: Depending on your xterm version

Can't make work ScrollWheel map in vim

 ̄綄美尐妖づ 提交于 2019-12-14 03:15:07
问题 I have a little problem with mapping vim shortcuts for my mouse wheel. I can't make this work : set mouse=a set nowrap noremap <C-ScrollWheelUp> 3zh noremap <C-ScrollWheelDown> 3zl On the other hand, the following is working (but not convenient, i just tested it to see if ScrollWheelUp/Down was working) : set mouse=a set nowrap noremap <ScrollWheelUp> 3zh noremap <ScrollWheelDown> 3zl What is my problem ? 来源: https://stackoverflow.com/questions/17083641/cant-make-work-scrollwheel-map-in-vim

Cannot open display while running X Apps as another user

安稳与你 提交于 2019-12-13 06:40:56
问题 I am currently using X11RDP to connect to a RHEL 6.5 endpoint , as root user. All X apps work fine, and directed properly to the right display (say 11.0). Now if I switch to another user ( su - user1 ), then I try to open any X app (say xterm) it will be unable to open the display (even though it is also 11.0). I do not believe the problem to be with xauth (magic cookies, etc), or the DISPLAY environment variable not being set correctly, or allowing connection with xhost + ; but rather

How to run another java process with console in java (in Linux)

ぃ、小莉子 提交于 2019-12-13 06:25:19
问题 How can I run an another java process (with a console) in Linux? I know I should use ProcessBuilder or Runtime.getRuntime().exec() to execute a command, but I want to know how I can show an separate X-window command terminal (ex. /usr/bin/xterm ) or at least show an console-terminal looking window and run a java process with stdin,stdout,stderr on that. Is there any solution? I heard the Process.getOutputStream() doesn't work on xterm, but haven't tried it yet (Because I'm using Windows..)