terminal

How do I determine size of ANSI terminal?

元气小坏坏 提交于 2019-12-10 13:26:12
问题 Standard input and output are connected to a terminal that implements ANSI escape sequences, but is of unknown dimensions. I need to know how big the terminal so to facilitate drawing a full-screen text UI on it. How can I get the size? The correct size is not loaded into environment variables. I cannot use TIOCGETS; the the call would return success but the values are not correct -- the kernel doesn't know the size either. There are lots and lots of answers searching stackoverflow, but they

Why can I not commit? (Your branch is up-to-date with 'origin/master', no changes added to commit)

杀马特。学长 韩版系。学妹 提交于 2019-12-10 12:55:51
问题 I have been having some trouble committing a file to GitHub. I can make it to git add, but soon as I try $ git commit -m 'my message' I get an error, not allowing me to complete the process of adding a file. $ git add HelloWorld.md $ git commit -m 'Hello world' I get the following answer (deleted: README.md & .DS_Store are in red): On branch master Your branch is up-to-date with 'origin/master'. Changes not staged for commit: deleted: README.md Untracked files: .DS_Store no changes added to

Bash printing color codes literally and not in actual color

亡梦爱人 提交于 2019-12-10 12:53:13
问题 For some reason my shell script stopped printing my menu in color and is actually printing the literal color code instead. Did I somehow escape the color coding? Script #!/bin/bash function showEnvironments { echo -e "\e[38;5;81m" echo -e " SELECT ENVIRONMENT " echo -e "[1] - QA" echo -e "[2] - PROD" echo -e "\e[0m" } showEnvironments Output \e[38;5;81m SELECT ENVIRONMENT [1] - Staging [2] - QA \e[0m I am using iTerm on Mac OSX and the TERM environment variable is set to xterm-256color . 回答1:

Create new user group in Mac OS [closed]

别来无恙 提交于 2019-12-10 12:43:49
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 7 years ago . With the need of create new user, I perform with the link below: http://osxdaily.com/2007/10/29/how-to-add-a-user-from-the-os-x-command-line-works-with-leopard/ It works great. But how to create new group? 回答1: "System preferences" -> "Accounts" -> "+" (as if you were adding new account) -> Under "New account"

Syntax error: File to import not found or unreadable: foundation/common/ratios

与世无争的帅哥 提交于 2019-12-10 12:35:55
问题 I have foundation installed and when I edit and save the app.scss file it creates a "app.css" and a "config.rb" file in the sass folder of my project. when I open that "app.css" file I get this Syntax error: File to import not found or unreadable: foundation/common/ratios. and then under that I get this: File to import not found or unreadable: foundation/common/ratios. Load paths: /Applications/MAMP/htdocs/WebApp02/sass /Library/Ruby/Gems/1.8/gems/compass-0.12.2/frameworks/blueprint

how do I run a java program from a c program?

不打扰是莪最后的温柔 提交于 2019-12-10 12:34:08
问题 I have googled for this, but the results are either 10+ years old and do not explain what JNI is or if it is the only approach, or the results are for C++ or C#. So here is my question: How do I run a Java program from a C program, using the following code as an example? What specific changes to I make to the following code to get the C program to successfully call the java program with parameters? In the CentOS terminal, I am able to successfully run a java program when I type the following

error while trying to run make command

喜欢而已 提交于 2019-12-10 12:24:01
问题 I'm trying to clone and make this project to use in Vivado: https://github.com/olajep/parallella-fpga/tree/2016.11 after I've cloned it then I use git submodule init and the gir submodule update command. after that I used make command and I get this message: Traceback (most recent call last): File "/usr/lib/command-not-found", line 28, in <module> from CommandNotFound import CommandNotFound File "/usr/lib/python3/dist-packages/CommandNotFound/CommandNotFound.py", line 19, in <module> from

Flask image upload in HTML?

陌路散爱 提交于 2019-12-10 12:24:01
问题 So, I wanted to upload an image in my website(HTML). The box does show up when I run the code but it does not show the image, instead it shows the image name. This is the code I used: app = Flask( name ) <img src="{{ url_for('static', filename='image.jpg') }}" alt="image.jpg" width=208 length=284> I did try putting my image and code in the directory : /html/static I even tried a code as simple as this but it didn't work: from flask import Flask app = Flask(__name__) @app.route('/new') def new

How do I set plist values

岁酱吖の 提交于 2019-12-10 12:07:25
问题 I am trying to change some Safari settings and am trying to use com.apple.Safari.plist for this. These are the following key values I need to change com.apple.Safari.ContentPageGroupIdentifier.WebKit2JavaScriptEnabled WebKitJavaScriptEnabled com.apple.Safari.ContentPageGroupIdentifier.WebKit2JavaScriptCanOpenWindowsAutomatically WebKitJavaScriptCanOpenWindowsAutomatically com.apple.Safari.ContentPageGroupIdentifier.WebKit2PluginsEnabled WebKitPluginsEnabled WebKitJavaEnabled I tried changing

Python: Non-blocking read from file/stream in Cygwin

陌路散爱 提交于 2019-12-10 12:06:47
问题 If I was on a Unix system, then I could do something like this in Python to open a file in non-blocking mode: fd = os.open(filepath, os.O_NONBLOCK) However, in Windows, os.O_NONBLOCK does not exist, and one would get an os module error 'module' object has no attribute O_NONBLOCK , if we tried to use it. We would have to do something like this for non-blocking input: https://github.com/jonathanslenders/python-prompt-toolkit/blob/master/prompt_toolkit/terminal/win32_input.py#L99 How does non