xterm

Terminfo smkx and Application Cursor Keys vs Application keypad

妖精的绣舞 提交于 2019-12-10 15:09:34
问题 XTerm Control Sequences specifies the following key sequences: CSI ? 1 h → Application Cursor Keys (DECCKM) CSI ? 1 l → Normal Cursor Mode (DECOM) CSI ? 66 h → Application keypad (DECNKM) CSI ? 66 l → Numeric keypad (DECNKM) and the Terminfo Source Format has the following entry: Variable: keypad_xmit Capname: smkx Termcap: ks Description: Put terminal in "keypad-transmit" mode But the terminfo for xterm actually says smkx=\E[?1h\E= , which seems mixed up to me (smkx should affect the keypad,

Xterm terminal and resize code

家住魔仙堡 提交于 2019-12-10 12:02:18
问题 I am in progress of converting a really old 25+ year old application . It sends an escape sequence to make the SCREEN 132 characters wide... However it didnt work and i put the XTERM equilivment that seems to work in most cases.. It is "\x1B[8;50;132t" Although the screen resizes with success there is an issue Here is the code that the COBOL program uses to execute the command pg -f FILETOSHOW using CALL "SYSTEM" USING BY CONTENT DS-REC where DS-REC is the above command.... The problem is

Embed xterm into QWidget and communicate with it

a 夏天 提交于 2019-12-10 09:59:14
问题 I want to embed an xterm into a pyqt4 widget and communicate with it. Especially I want to be able to print to it and execute commands on it (such that it returns to normal user prompt after executing the command just like a normal shell would do). Consider the following minimal example. How can I make it work? #!/usr/bin/env python #-*- coding:utf-8 -*- import sys from PyQt4.QtCore import * from PyQt4.QtGui import * class embedxterm(QWidget): def __init__(self): QWidget.__init__(self) self

Emacs/xterm color annoyance on Linux

一笑奈何 提交于 2019-12-10 02:54:30
问题 I'm using emacs in a console window both on my local Linux box and on the login node of a remote cluster. I use emacs regularly, and I've got the foreground color set to white in my .emacs file like so: (set-foreground-color "white") (set-background-color "black") However, when I run emacs, the foreground isn't white; it's grey and very hard to read. On my Mac, emacs in a console window with the same settings shows up as proper white. But on both linux boxes, in konsole and xterm, it's grey.

How to implement proper mouse support in a terminal / terminfo entry?

余生长醉 提交于 2019-12-07 06:00:55
问题 I've implemented a terminal emulator and a corresponding terminfo entry that allows me to run ncurses programs like emacs , mc (midnight commander) or tig (git browser). I want to add mouse support to the terminal , most notably to position the cursor in emacs by clicking into the window. After a lot of googling and some help on stackoverflow I learned about the required terminfo fields (most notably kmous ) and control (e.g. \E[?1000h ) and "key" ( \E[M... ) sequences and implemented mouse

How to change cursor shape depending on VI mode in Bash?

社会主义新天地 提交于 2019-12-07 00:02:21
问题 I have the following line in my .bashrc: set -o vi And I want my cursor to have a pipe shape when I am in insert mode and a block shape when I am in command mode, like what I would have in Vim if I placed the following in my .vimrc: let &t_SI = "\e[6 q" let &t_SR = "\e[4 q" let &t_EI = "\e[2 q" Except in this case I want to have the equivalent behavior on the command line. I found a partial answer to my question here - https://unix.stackexchange.com/questions/22527/change-cursor-shape-or

Automating xterm using Expect

假装没事ソ 提交于 2019-12-06 07:27:06
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 spawn $env(SHELL) Don Libes mentioned that from this point, xterm can be automated and he has given

Embed xterm into QWidget and communicate with it

故事扮演 提交于 2019-12-05 21:18:11
I want to embed an xterm into a pyqt4 widget and communicate with it. Especially I want to be able to print to it and execute commands on it (such that it returns to normal user prompt after executing the command just like a normal shell would do). Consider the following minimal example. How can I make it work? #!/usr/bin/env python #-*- coding:utf-8 -*- import sys from PyQt4.QtCore import * from PyQt4.QtGui import * class embedxterm(QWidget): def __init__(self): QWidget.__init__(self) self.setMinimumWidth(900) self.setMinimumHeight(400) self.process = QProcess(self) self.terminal = QWidget

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

折月煮酒 提交于 2019-12-05 09:39:24
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? 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 supported in the Mac OS X Terminal.App though. There are some terminal programs that supporting it (xterm has

How to implement proper mouse support in a terminal / terminfo entry?

梦想的初衷 提交于 2019-12-05 09:11:35
I've implemented a terminal emulator and a corresponding terminfo entry that allows me to run ncurses programs like emacs , mc (midnight commander) or tig (git browser). I want to add mouse support to the terminal , most notably to position the cursor in emacs by clicking into the window. After a lot of googling and some help on stackoverflow I learned about the required terminfo fields (most notably kmous ) and control (e.g. \E[?1000h ) and "key" ( \E[M... ) sequences and implemented mouse button events in my terminal. I've written a small ncurses program that goes something like this: