terminal

Is it possible to run wget using both -O and -P options together?

拈花ヽ惹草 提交于 2020-07-22 09:47:50
问题 I want to download a program. For example "package.zip" I want to download it in, for example "~/programs/downloaded" I want to name it, for example "new.zip" So I tried: wget -P ~/programs/downloaded \ -O new.zip https://somewebsite.com/package.zip But it only downloaded the package in the terminal's current directory and renamed it. The -P command does not work. Any idea how to make it work? 回答1: This is a feature of wget that has bitten many people. Unfortunately, it was a design decision

How to execute terminal command in swift?

谁说我不能喝 提交于 2020-07-18 06:42:08
问题 I am new toSswift. How can I run this process from Swift code? open Terminal window execute cd Desktop/firebase-mac execute npm start What I am actually trying to do is to start Node server on click from Swift code. 回答1: Full examples: go to some directory, let say Desktop Create a file with name swsh , and add into it (plaintext, not rtf, or doc) #!/usr/bin/env xcrun swift import Foundation func shell(launchPath: String, arguments: [String]) -> String { let process = Process() process

Proper way to exit command line program?

懵懂的女人 提交于 2020-07-17 09:34:23
问题 I'm using mac/linux and I know that ctrl-z stops the currently running command in terminal, but I frequently see the process is still running when i check the system monitor. What is the right way to stop a command in terminal? Typically I run into this issue when running python or ruby apps, i'm not sure if that has something to do with it, just thought I would add that. 回答1: Using control-z suspends the process (see the output from stty -a which lists the key stroke under susp ). That

Configure key repeat delay to detect if key is being pressed

有些话、适合烂在心里 提交于 2020-07-15 08:55:49
问题 I am writing a program in C that uses ncurses to check if a key is being pressed. The problem is that there is a key repeat delay. If I for example hold the key 'a' while in the terminal there is a short delay before 'a' gets repeatedly entered. I want to be able to know if it is being pressed from the point where it is actually pressed. How do temporarily change this delay to be equal to 0 while in the terminal? I'm currently using Mac OSX 10.10.5. 回答1: With ncurses (any curses

Configure key repeat delay to detect if key is being pressed

纵饮孤独 提交于 2020-07-15 08:55:06
问题 I am writing a program in C that uses ncurses to check if a key is being pressed. The problem is that there is a key repeat delay. If I for example hold the key 'a' while in the terminal there is a short delay before 'a' gets repeatedly entered. I want to be able to know if it is being pressed from the point where it is actually pressed. How do temporarily change this delay to be equal to 0 while in the terminal? I'm currently using Mac OSX 10.10.5. 回答1: With ncurses (any curses

Somehow I can’t instal Homebrew

假装没事ソ 提交于 2020-07-10 10:26:29
问题 As described on the homebrew site (https://brew.sh/) this should be pretty straightforward, just open the terminal, paste and run. However, somehow it is not working for me and now a couple of hours in, I am getting very frustrated. I am a rookie and suspect this is some easy fix thing, so I would appreciate some help. I am on macOS Catalina, using zsh , and when I paste and run nothing happens, the cursor goes to the next line, and I can type, but nothing runs, no feedback. Which I

Somehow I can’t instal Homebrew

本小妞迷上赌 提交于 2020-07-10 10:26:23
问题 As described on the homebrew site (https://brew.sh/) this should be pretty straightforward, just open the terminal, paste and run. However, somehow it is not working for me and now a couple of hours in, I am getting very frustrated. I am a rookie and suspect this is some easy fix thing, so I would appreciate some help. I am on macOS Catalina, using zsh , and when I paste and run nothing happens, the cursor goes to the next line, and I can type, but nothing runs, no feedback. Which I

How do I change my VS Code terminal to cmd.exe instead of powershell?

老子叫甜甜 提交于 2020-07-09 12:02:21
问题 For some reason my VS Code terminal is Powershell instead of cmd.exe. In my Terminal > External: Windows Exec is set to C:\WINDOWS\System32\cmd.exe. However, when I open the Terminal in VS Code I see PS C:...>. Also, in the terminal drop-down I only see powershell as an option. How do I switch the Terminal to CMD.exe? Or maybe my better option would be to add cmd.exe to the list of available terminals so I can switch between them? 回答1: Open File -> Preferences -> Settings Select User Settings

Is it possible to have the Integrated Terminal open automatically on start of Visual Studio Code?

杀马特。学长 韩版系。学妹 提交于 2020-07-08 12:00:08
问题 Is it possible to configure User Settings to have the Integrated Terminal to start automatically when opening Visual Studio Code? 回答1: The following has worked for me: // Whether to restore terminal sessions for the workspace automatically when launching VS Code. This is an experimental setting; it may be buggy and could change in the future. Paste the below in your user settings: "terminal.integrated.experimentalRestore": true 回答2: There is now an extension that lets you set terminals on

output of [31m text instead of color

ぃ、小莉子 提交于 2020-07-06 07:47:03
问题 I am trying to print coloured text with colorama but when I compile an exe and run following... from colorama import Fore, Back, Style print(Fore.RED + 'text') print(Back.GREEN + 'and with a green background') print(Style.DIM + 'and in dim text') print(Style.RESET_ALL) print('back to normal now') I get output of:: Output: [31mtext [0m back to normal now Is it possible to print colors when compiling to pyinstaller exe or is this simply not possible? 回答1: On Windows, you have to initialize