terminal

How to create custom escape sequence in mac terminal

匆匆过客 提交于 2019-12-11 16:08:31
问题 I don't understand how to create custom escape sequence for Ctrl + Shift + S like in this question My problem is that I want to use Ctrl + Shift + S in emacs no-window mode under MacOS terminal. Currently I'm trying to bind this escape sequence to Ctrl + Shift + F12 but I have troubles creating that escape sequence. Maybe there is a batter way to use complex ( Ctrl - Shift + anykey ) bindings in MacOS terminal with emacs in no-window mode? 回答1: You're probably assuming that F12 is a character

Not able to execute terminal command(top) in python

僤鯓⒐⒋嵵緔 提交于 2019-12-11 15:55:14
问题 I have this command: top -d 1.0 -n 1| grep Mem when i execute it in terminal i get: KiB Mem : 16330216 total, 3902792 free, 10619512 used, 1807912 buff/cache KiB Swap: 8509436 total, 4584448 free, 3924988 used. 4848204 avail Mem I want to save this output in a text file. I want to keep a track of this every 10 seconds. Therefore i tried: def repeat(): print(time.ctime()) threading.Timer(10, repeat).start() f= open('ss.txt', 'w') top= os.system("sudo top -d 1.0 -n 1| grep Mem") s=str(top) text

How to exit alternate screen scrolling on iTerm2 Vim?

心已入冬 提交于 2019-12-11 15:19:13
问题 First, sorry if the title isn't precise. I'm in a weird situation, while using Vim on Mac iTerm2. More precisely, when I release two finger click it scrolls down 3 lines. Sort of same thing is mentioned at https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=683942 and its referred as "alternate screen scrolling". How do I came in this situation? Well, I was in a remote ssh session and just just closed macbook, put it on bag and went to lunch. When I came back I experienced this strange thing.

If you can dynamically change the font in the terminal like you can with CSS

浪子不回头ぞ 提交于 2019-12-11 15:16:14
问题 I have seen these two questions: Can I change the font of terminal? Is it possible to show mathematical symbols in the terminal? The answer to both is yes. I am wondering if it is possible to have a CLI print out mathematical symbols into the terminal from a custom font only it is personally using , while at the same time I never have to change the font on my terminal (I can keep using the default font for everything else). That is, say I have my default font for my terminal set to x . The

issue installing react icons with npm

て烟熏妆下的殇ゞ 提交于 2019-12-11 15:15:17
问题 I'm following a react tutorial on lynda.com. I'm trying to install react icons through npm to my react project. I'm getting some weird warnings in the command line that I don't understand. Here's the result in the tutorial vs. my result: This is the tutorial's result the terminal. This is my result in the terminal: Last login: Sat Aug 11 11:54:48 on ttys005 dashiell-bark-husss-macbook-pro-2:bulletin-board dashiellbark-huss$ npm install --save react-icons npm WARN rm not removing /Users

Python3: Trying to upgrade pip3 in Ubuntu 16.04 but it doesn't update

允我心安 提交于 2019-12-11 14:57:21
问题 Basically, the title. I want to upgrade pip because I cannot get new packages in python because it is obsolete. When I try to run pip3 install --upgrade pip from the Ubuntu terminal, this happens: Collecting pip Using cached pip-9.0.3-py2.py3-none-any.whl Installing collected packages: pip Found existing installation: pip 9.0.1 Uninstalling pip-9.0.1: Successfully uninstalled pip-9.0.1 Rolling back uninstall of pip Exception: Traceback (most recent call last): File "/home/marcell/.local/lib

MacOS Terminal Setup Skript

跟風遠走 提交于 2019-12-11 14:32:45
问题 Is there a way to automatically setup a MacOS Terminal Window? It should open a few tabs, rename some of them, transition to folders, launching other scripts (e.g. mongod) etc. 回答1: Like this maybe: #!/bin/bash osascript<<EOF tell application "Terminal" set newTab1 to do script "cd /etc && ls && echo && echo I am in /etc and in Ocean style" set current settings of newTab1 to settings set "Ocean" set newTab2 to do script "cd $HOME/Desktop && ls && echo && echo I am on your Desktop and in Man

python3 subprocess pip “ImportError: cannot import name main” in terminal

吃可爱长大的小学妹 提交于 2019-12-11 14:32:27
问题 I created a script (see below) to upgrade all my pip packages. I successfully executed my script via idle3 , i.e. open the script using idle3 and pressing F5 to run the script as a module. However, I am not able to execute it in the terminal; got the below error. How do I overcome this error? Why does the import error happen in terminal but not in idle3 ? $ python3 -m upgrade_pip_packages ==================================================== UPGRADING ALL --USER PIP PACKAGES TO LATEST VERSION:

Can't stop local node server with Ctrl + C (Mac)

寵の児 提交于 2019-12-11 14:29:06
问题 I have never had this problem when developing node server locally. It may have started after updating xCode. I tried with the simplest code var app = express(); var server = app.listen(process.env.PORT || '3000', '0.0.0.0', function() { console.log('App listening at http://%s:%s', server.address().address, server.address().port); }); process.on('SIGINT', function() { console.log("Exiting..."); process.exit(); }); but can't observe any log when I try Ctr+C to quit. UPDATE When I tried pressing

Cygwin terminal buffers STDOUT

六月ゝ 毕业季﹏ 提交于 2019-12-11 14:26:40
问题 I use Altera Quartus software which comes with its own Cygwin distribution and a dumb terminal which, according to the shortcut placed in my Start Menu by Altera, is run using cmd.exe /c "c:\altera\15.1\nios2eds\NiosII Command Shell.bat" where this batch file configures the environment for Quartus and launches bash. When I use this window to run Altera tools, their output comes out immediately (not buffered) and in color. I also have my own Cygwin installation with an Xserver and terminals (i