xterm

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

冷暖自知 提交于 2019-12-05 09:05:37
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-color-to-indicate-vi-mode-in-bash - written by @gogolb. Here is the answer, copied: #!/bin/bash # Script

How does Vim guess background color on xterm?

为君一笑 提交于 2019-12-04 13:00:31
Vim has the ability to correctly guess the background color of an Xterm in order to set its internal option bg to either dark or white according to the terminal's one. Vim is able to do that correctly only when TERM is set to either xterm {, -color , -256color } or linux but no others like tmux or screen . How does Vim to guess that? I've found that most people forces setting up the background option to either dark or light in their .vimrc file; but I'd like a way to guess the same way Vim does, independently of the terminal being xterm , tmux , screen . osgx The default setting is defined

vim in Cygwin replaces first character with 'g' on opening a file

夙愿已清 提交于 2019-12-04 10:45:34
I use vim in Cygwin terminal. It was working fine. Recently, I added a package in Cygwin which caused update of vim and some other components. Now when I open any file in vim, the first character in the file gets replaced with character 'g'. I tried removing .vimrc and all files in .vim folder in my home folder. But the problem persists. To understand the problem, I opened a file using 'vim -E'. On opening, I see the following at the bottom of the window: Entering Ex mode. Type "visual" to go to Normal mode. :]11;rgb:0000/0000/0000\ The key sequence rgb in vim would replace the first character

Executing string sent from one terminal in another in Linux pseudo-terminal

我与影子孤独终老i 提交于 2019-12-04 06:57:42
问题 Lets say I have one terminal where the output of "tty" is "/dev/pts/2" From another terminal, I want to send a command to the first terminal and execute it. Using: echo "ls" > "/dev/pts/2" only prints "ls" in the first terminal Is there a way to execute the string? 回答1: No; terminals don't execute commands. They're just channels for data. You can sort of run a command and attach it to another terminal like this, though: ls </dev/pts/2 >/dev/pts/2 2>/dev/pts/2 It won't behave exactly like you

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

寵の児 提交于 2019-12-03 07:53:01
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 from my QDialog). Does anybody got the same problem? Sorry, I've tried your solution before posting oh

vim screen restore

守給你的承諾、 提交于 2019-12-03 06:02:55
问题 i use vim in screen for development and if i quit vim, the current screen-content stays there... outside the screen (xterm), exiting vim will restore the previous buffer (like: [ server1 ]~$ cmd some stuff, some stuff [ server1 ]~$ cmd [ server1 ]~$ cmd ) But not inside screen. I tried to use xterm as terminal inside screen - but not with the wanted effect. Thanks for Help! 回答1: In the file .screenrc in your home directory, add the line: altscreen on That should fix it. According to the man

How do I copy text from my xterm without a mouse?

痴心易碎 提交于 2019-12-03 02:44:36
问题 I want to use part of the output of a command run from the command line in another xterm, or as part of a different command. For instance: > grep error error.log error: can't find file ~/<some very long path>/thisfile and I want to do this: >ls ~/<some very long path>/ I know two ways to do this: 1. copy ~/<some very long path>/ with the mouse. 2. use some combination of head / tail / awk / sed / perl / cut /etc... to extract only what I need from the output and then use that inside backticks

Read the current text color in a xterm

℡╲_俬逩灬. 提交于 2019-12-03 01:04:53
问题 I'm writing various utilities, and I'm really liking colorized text. Nothing fancy, just using escape sequences. I've created a simple class that has a pprint(msg, color) function. I've got it working rather easily after finding the codes here. The problem that I'm having is that I should be able to turn off the color after printing. For example, let's say a user runs my program that prints almost everything in the default terminal color, but there is an error, and I want to print the error

Color ouput with Swift command line tool

牧云@^-^@ 提交于 2019-12-02 20:45:55
I'm writing a command line tool with Swift and I'm having trouble displaying colors in my shell. I'm using the following code: println("\033[31;32mhey\033[39;39m") or even NSFileHandle.fileHandleWithStandardOutput().writeData("\033[31;32mhey\033[39;39m".dataUsingEncoding(NSASCIIStringEncoding, allowLossyConversion: true)!) It works when I use a simple echo in php (the text is displayed in green) but is there a reason it doesn't work in a Swift command line tool? Thanks! cyt Swift has built in unicode support. This invalidates using of back slash. So that I use color codes with "\u{}" syntax.

How do I copy text from my xterm without a mouse?

十年热恋 提交于 2019-12-02 16:38:24
I want to use part of the output of a command run from the command line in another xterm, or as part of a different command. For instance: > grep error error.log error: can't find file ~/<some very long path>/thisfile and I want to do this: >ls ~/<some very long path>/ I know two ways to do this: 1. copy ~/<some very long path>/ with the mouse. 2. use some combination of head / tail / awk / sed / perl / cut /etc... to extract only what I need from the output and then use that inside backticks. Is there any way to copy text without using the mouse? The example that comes to mind is visual mode