terminal

Intellij IDE terminal does not show accented characters

只愿长相守 提交于 2019-12-22 08:59:41
问题 I try to insert portuguese/spanish characters (example: á, ã, à, é, ú, ô, õ, ç) on Intellij's terminal, but they are not shown. How can I do it? 回答1: This has been finally fixed in IntelliJ IDEA 2016.3.1, Build #IC-163.9166.29, built on December 9, 2016 Thanks to all the voters on JetBrain YouTrack :) 来源: https://stackoverflow.com/questions/25003756/intellij-ide-terminal-does-not-show-accented-characters

How to set the terminal's size?

為{幸葍}努か 提交于 2019-12-22 08:15:19
问题 How do I get the terminal size in Go. In C it would look like this: struct ttysize ts; ioctl(0, TIOCGWINSZ, &ts); But how to i access TIOCGWINSZ in Go 回答1: The cgo compiler can't handle variable arguments in a c function and macros in c header files at present, so you can't do a simple // #include <sys/ioctl.h> // typedef struct ttysize ttysize; import "C" func GetWinSz() { var ts C.ttysize; C.ioctl(0,C.TIOCGWINSZ,&ts) } To get around the macros use a constant, so // #include <sys/ioctl.h> //

“Pseudo-terminal will not be allocated because stdin is not a terminal” when running ssh through python without paramiko

ⅰ亾dé卋堺 提交于 2019-12-22 08:09:27
问题 I am running ssh from within Python without the use of an external library like Paramiko. I have my reasons for doing it this way instead of through an external library. Basically I am doing subprocess.Popen("ssh -t bla -- command") I get the following message when doing this: Pseudo-terminal will not be allocated because stdin is not a terminal. The reason I am running it with -t is I want the remote command to terminate when I kill my python script. When I try with -t -t (to force it), I

How can my shell script determine whether it's in a real shell or not?

两盒软妹~` 提交于 2019-12-22 08:08:32
问题 I have a shell script that runs in my personal terminal and in a CI environment. In the CI environment, the python calls for determining shell height/width return funny values. I would like to do something to the effect of: if (I am running in shell context) determine height/width of terminal else don't fi How can I express this condition, in a bash script? 回答1: Check if standard input is a tty device. In sh/bash: if [ -t 0 ]; then In Python: if os.isatty(sys.stdin): 来源: https://stackoverflow

Using os.forkpty() to create a pseudo-terminal to ssh to a remote server and communicate with it

社会主义新天地 提交于 2019-12-22 07:23:05
问题 I'm trying to write a python script that can ssh into remote server and can execute simple commands like ls,cd from the python client. However, I'm not able to read the output from the pseudo-terminal after successfully ssh'ing into the server. Could anyone please help me here so that I could execute some commands on the server. Here is the sample code: #!/usr/bin/python2.6 import os,sys,time,thread pid,fd = os.forkpty() if pid == 0: os.execv('/usr/bin/ssh',['/usr/bin/ssh','user@host',]) sys

not able to use svn command from terminal in Mac OS 10.8

我们两清 提交于 2019-12-22 07:08:31
问题 Team SVN commands were working fine in terminal. I have uninstalled and installed the latest version of my svnclient. from then, i'm not able to access the svn commands from terminal in my mac. following is the error message i see in terminal dyld: Library not loaded: /opt/local/lib/libssl.1.0.0.dylib Referenced from: /usr/local/bin/svn Reason: image not found Trace/BPT trap: 5 I'm using Mac OS 10.8.2 Kindly help me to fix this. 回答1: It looks like your local copy of "svn" (installed in /usr

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

Color themes are strange/incorrect in terminal emulator

对着背影说爱祢 提交于 2019-12-22 06:28:36
问题 I'm running emacs-nox 23.3 in Konsole (from kde) emulator, the most color themes have strange colors. For example, i like the Solarized Theme. I expect the theme should look like this: (source: ethanschoonover.com) However, this is what I get: Broken Solarized Theme http://img824.imageshack.us/img824/3881/voronoi2.png Most of themes that comes in emacs-color-theme package have similar behavior. I tried to change the Konsole color settings - no result. I also tried to replace my .Xresources

Error: EACCES, permission denied even after using sudo?

时光总嘲笑我的痴心妄想 提交于 2019-12-22 06:10:48
问题 I am trying to set up a chrome extension that will automatically save the changes I make to my website with the inspect element feature. The idea is that you'll be able to make real time changes to the website without having to go back into the ide to save the changes and re-upload and everything. The extension is called DevTools Autosave. I've been following the instructions from this site. I'm trying to install this on a mac. I've installed node.js and the extension already. When I got to

“sh: sysctl Command not Found ” for Mac OS X running a cron job

好久不见. 提交于 2019-12-22 05:55:08
问题 I have a python script, script.py , and am using cron to run this script periodically. The script runs as expected, but once the cron job finishes, I get the following error in /var/mail/[myusername]: sh: sysctl Command Not Found The following is the cron job: 0 14 * * * PATH=$PATH:/usr/sbin PYTHONPATH=/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/ /usr/bin/python2.7 ~/.../script.py I was told to include both PATH and PYTHONPATH in the task (as before, python