terminal

difference between pty and a pipe

左心房为你撑大大i 提交于 2020-05-25 04:19:50
问题 I have been reading about ptys from this page's example: http://rachid.koucha.free.fr/tech_corner/pty_pdip.html. I have two questions: What is the difference, or the most important difference, between using a pty and using a pipe? From what I have read, both are for inter-process communication, but with a pty the process can "treat it like a normal terminal". What does that mean? What is a "controlling terminal"? I have read about them but can't understand what they really are. Is the

difference between pty and a pipe

﹥>﹥吖頭↗ 提交于 2020-05-25 04:19:26
问题 I have been reading about ptys from this page's example: http://rachid.koucha.free.fr/tech_corner/pty_pdip.html. I have two questions: What is the difference, or the most important difference, between using a pty and using a pipe? From what I have read, both are for inter-process communication, but with a pty the process can "treat it like a normal terminal". What does that mean? What is a "controlling terminal"? I have read about them but can't understand what they really are. Is the

Changing the default path of Visual Studio Code's integrated terminal

对着背影说爱祢 提交于 2020-05-24 21:19:07
问题 I'm trying to change the default path of the integrated terminal in Visual Studio Code, but I'm not sure how to. I do know how to change it in the windows command prompt, but not in Visual Studio Code. I looked in user settings, but I can't find anything there to change. The current default path is C:\Users\User_Name . I'd like to change it to C:\Project . How do I do this in Visual Studio Code? 回答1: Short answer Edit the user preference "terminal.integrated.cwd": "" to the path that you want

npm install fails on node-gyp rebuild with ```gyp: No Xcode or CLT version detected!```

萝らか妹 提交于 2020-05-24 21:17:12
问题 Every time I try to do npm install I am getting the following error. How do I fix this? I am on node -v → v8.8.0 & npm -v → v6.11.3 I tried running it on vsCode terminal and iTerm , I ended up getting the same error. (both are updated to the latest version). The only new thing I did is update my macOS to the latest version i.e., Catalina 10.15.3 today. $ npm install Fri Mar 6 17:22:40 2020 > fsevents@1.2.11 install /Users/synapse/Documents/synapsefi-dev-ui/node_modules/watchpack/node_modules

Failed to add the host to the list of know hosts

无人久伴 提交于 2020-05-24 08:50:48
问题 Mac OSX Lion 10.7. In an effort to get around weird environment stuff (homebrew wasn't installing wget, and I had all sorts of weird blocks and errors), I uninstalled zschrc and homebrew and a bunch of other stuff, then installed fish shell. Now, whenever I try to push/pull to/from github, I get this error: The authenticity of host 'github.com (204.232.175.90)' can't be established. RSA key fingerprint is <string of colon-separated chars that I should probs keep private>. Are you sure you

syntax error near unexpected token '(' in bash script when selecting files

拟墨画扇 提交于 2020-05-20 10:49:50
问题 Running this script bash ./cleanup.bash #!/bin/bash ## going to dir moving stuff rm -rf !(composer.json|.git) Gives the error: cleanup.bash: line 10: syntax error near unexpected token '(' cleanup.bash: line 10: 'rm -rf !(composer.json|.git)' But if I run in in the terminal directly no problem rm -rf !(composer.json|.git) I tried stripping out all other lines, still get the error. How do I enter this correctly in the bash script? 回答1: I guess your problem is due the shell extended glob option

syntax error near unexpected token '(' in bash script when selecting files

廉价感情. 提交于 2020-05-20 10:49:17
问题 Running this script bash ./cleanup.bash #!/bin/bash ## going to dir moving stuff rm -rf !(composer.json|.git) Gives the error: cleanup.bash: line 10: syntax error near unexpected token '(' cleanup.bash: line 10: 'rm -rf !(composer.json|.git)' But if I run in in the terminal directly no problem rm -rf !(composer.json|.git) I tried stripping out all other lines, still get the error. How do I enter this correctly in the bash script? 回答1: I guess your problem is due the shell extended glob option

syntax error near unexpected token '(' in bash script when selecting files

ε祈祈猫儿з 提交于 2020-05-20 10:49:09
问题 Running this script bash ./cleanup.bash #!/bin/bash ## going to dir moving stuff rm -rf !(composer.json|.git) Gives the error: cleanup.bash: line 10: syntax error near unexpected token '(' cleanup.bash: line 10: 'rm -rf !(composer.json|.git)' But if I run in in the terminal directly no problem rm -rf !(composer.json|.git) I tried stripping out all other lines, still get the error. How do I enter this correctly in the bash script? 回答1: I guess your problem is due the shell extended glob option

golang simple server with interactive prompt

独自空忆成欢 提交于 2020-05-17 07:09:05
问题 I am trying to build a simple CLI interface for my go process, I need to listen and serve on TCP port and get stats when connected to the port on TCP . I came across 'terminal' package to help with Password prompt, command history and other things. I tried to write up some code to achieve this. Although my client is not receiving any prompt or server is stuck on 'ReadLine' method. Any helpers? package main import ( "bufio" "fmt" "golang.org/x/crypto/ssh/terminal" "io" "net" _ "time" ) func

Shell Script Too Many Arguments for if condition

时光怂恿深爱的人放手 提交于 2020-05-15 07:56:39
问题 My current script does the following; It takes integer as a command line argument and starts from 1 to N , it checks whether the numbers are divisible by 3, 5 or both of them. It simply prints out Uc for 3, Bes for 5 and UcBes for 3,5. If the command line argument is empty, it does the same operation but the loop goes to 1 to 20. I am having this error "Too many arguments at line 11,15 and 19". Here is the code: #!/bin/bash if [ ! -z $1 ]; then for i in `seq 1 $1` do if [ [$i % 3] -eq 0 ];