terminal

Python’s `str.format()`, fill characters, and ANSI colors

丶灬走出姿态 提交于 2020-06-24 08:39:17
问题 In Python 2, I’m using str.format() to align a bunch of columns of text I’m printing to a terminal. Basically, it’s a table, but I’m not printing any borders or anything—it’s simply rows of text, aligned into columns. With no color-fiddling, everything prints as expected. If I wrap an entire row (i.e., one print statement) with ANSI color codes, everything prints as expected. However: If I try to make each column a different color within a row, the alignment is thrown off. Technically, the

Shortening my prompt in Zsh

放肆的年华 提交于 2020-06-24 08:24:05
问题 I'm having a lot of trouble getting zsh to shorten my prompt. I'm currently using zsh with the agnoster theme and oh-my-zsh package manager. My prompt currently gets annoyingly long during work, usually around 110 characters, taking up the entire length of my terminal, which is just not very aesthetically pleasing. I've looked at a few other people's .zshrc's and attempts to modify their prompt, but nothing seems to work in mine. I've tried copying many, many things into my .zshrc and have

Determine terminal/TTY background color at runtime

浪子不回头ぞ 提交于 2020-06-22 18:01:48
问题 Using the chalk library to stylize/colorize the terminal. import chalk from 'chalk'; if I use: console.log(chalk.blue('foobar')); that's totally readable in a terminal with a light background, but totally unreadable in a terminal with a dark background. Is there some way to determine the background color of a terminal at runtime? Example given: The "npm notice" log level is a case of this problem: It's difficult to read the blue on black. 回答1: The following is a generic answer, about ANSI

Kivy-iOS toolchain wont run 'Permission Denied'

时光毁灭记忆、已成空白 提交于 2020-06-17 15:53:29
问题 Im trying to convert a kivy app to run on iOS and have followed the information on the kivy site. However, once everything is downloaded the first step is to compile the toolchain process, which I cant do. So the command ./toolchain.py openssl kivy returns ./toolchain.py: Permission denied No other messages so a bit difficult to troubleshoot. I found this post. That suggestion hasn't been accepted or marked as correct, but I tried anyway and changing permissions doesn't fix the problem. I

How to install Windows Terminal on VS code

南楼画角 提交于 2020-06-17 15:29:06
问题 All in title. Also i'm russian and this is Google Translate. I opened the process in Task Manager and went to the file location. There was an error with access denial, but it was solved with the help of Computer Control. But I don't know how to open this particular terminal in vs code. I introduced OpenConsole first.Yes, but it was only a terminal. But that's what I'm interested in. SCREENSHOT 回答1: I think you want to launch the new Windows Terminal from within VS Code . What you need to do

Segmentation fault on trying to execute value at environment variable

生来就可爱ヽ(ⅴ<●) 提交于 2020-06-17 04:19:09
问题 Hey so I was trying to solve a problem for beginners ctf event. And this is the code that I am trying to run. #include <stdio.h> #include <stdlib.h> int main(){ int (*func)(); func = getenv("MYENV"); func(); return 0; } I created a MYENV environment like this : export MYENV=ls but on running the code, it throws a segmentation fault (core dumped) . I don't understand why. The func function is basically calling the environment variable whose value is a simple command that I set. Why is it

How to add flutter SDK to PATH permanently on ubuntu linux?

安稳与你 提交于 2020-06-17 03:47:07
问题 I'm very new to using linux as my primary OS. Yesterday I just did a clean install of ubuntu on my pc. I after that I started setting up my desktop. Anything necessary is being installed to run flutter but whenever I run flutter flutter: command not found . I have tried seeing similar questions on stackoverflow but I do not see specific configuration of adding flutter to PATH on ubuntu and it is kinda confusing to me since I'm not experienced with linux for now. When I enter the following

How can I open multiple tabs automatically on terminal in mac os Lion by executing some commands on each tab?

自闭症网瘾萝莉.ら 提交于 2020-06-12 12:20:19
问题 I need to automatically open terminal with multiple tabs and need to execute multiple commands on it. I know how to do it in ubuntu. but its not working on mac os . Any Idea? gnome-terminal --tab -e "tail -f somefile" --tab -e "some_other_command" 回答1: I can give you a clue. Using osascript , you can do it. UPDATE: One thing you need to understand is, gnome-terminal is for Linux. Gnome is a very popular Desktop environment written for Linux. Use this oneliner for opening a new tab with $PWD

How can I open multiple tabs automatically on terminal in mac os Lion by executing some commands on each tab?

…衆ロ難τιáo~ 提交于 2020-06-12 12:16:15
问题 I need to automatically open terminal with multiple tabs and need to execute multiple commands on it. I know how to do it in ubuntu. but its not working on mac os . Any Idea? gnome-terminal --tab -e "tail -f somefile" --tab -e "some_other_command" 回答1: I can give you a clue. Using osascript , you can do it. UPDATE: One thing you need to understand is, gnome-terminal is for Linux. Gnome is a very popular Desktop environment written for Linux. Use this oneliner for opening a new tab with $PWD

How can I open multiple tabs automatically on terminal in mac os Lion by executing some commands on each tab?

不想你离开。 提交于 2020-06-12 12:15:45
问题 I need to automatically open terminal with multiple tabs and need to execute multiple commands on it. I know how to do it in ubuntu. but its not working on mac os . Any Idea? gnome-terminal --tab -e "tail -f somefile" --tab -e "some_other_command" 回答1: I can give you a clue. Using osascript , you can do it. UPDATE: One thing you need to understand is, gnome-terminal is for Linux. Gnome is a very popular Desktop environment written for Linux. Use this oneliner for opening a new tab with $PWD