When I ran the command "gh auth login" in gitbash , I get "You appear to be running in MinTTY without pseudo terminal support." - github-cli

Here is the bug in gitbash,thanks for your reply.
$ gh auth login
? What account do you want to log into? [Use arrows to move, type to filter]
> GitHub.com
GitHub Enterprise Server
could not prompt: Incorrect function.
You appear to be running in MinTTY without pseudo terminal support.
To learn about workarounds for this error, run: gh help mintty

YES! I solve the bug accidentally. Sometimes we don't need to figure out what the bug tips want us to do like this bug tips.
Firstly,you should find where your github cli install.
Then,open the terminal in this directory.You can download github cli in here.
Finally,you can find you can get want you want when you input gh auth login

Related

Unable to run node from git bash

I am no longer able to run node from the git bash terminal. It works from Git CMD and the standard windows CLI. If I try to run a file (e.g. node index.js) or even just start node via node, I go back to the input prompt except now I can't see any of my character inputs.
This is not a result of PATH not being set, as where node gives me C:\Program Files\nodejs\node.exe and which node gives me /c/Program Files/nodejs/node and echo $PATH does have /c/Program Files/nodejs included.
If I type another command (such as ls), it actually will work even though I will continue to not be able to see my input.
I think this problem arose after the latest Windows 10 OS update was pushed to my system (10.0.17763). I've tried reinstalling Git for Windows and Node, and neither have resolved the issue. I can't find any other settings that might be affecting this.
Using Git CMD or Windows CLI is a workaround, but neither of those have a "Git Bash Here" option, which is the #1 thing I want this for. It is also nice that I get the visual indication of branch in Git Bash where I do not get that with Git CMD or the Windows CLI.
I don't need or want to use Git GUI, and besides that won't allow me to run local node files which I need to do for testing.
Does anyone have any ideas on how I can get Git Bash working with node again?
UPDATE: By running stty -a after node fails, I see that echo has flipped to -echo, which is why I can't see the input anymore. But that doesn't explain why node isn't loading and echo is getting turned off. Hoping that gives someone some additional context to figure out what's going on here. brkint, icrnl, ixon, opost, isig, and icanon are also getting flipped to the - versions after attempting to run node.
There are 2 possible workarounds (based on what your problem is) that I have tried-
Enter node first of all:
1) Try typing in reset and hit enter. You may not be able to see the input logging in, in the bash terminal window, but it works after that.
2) Or try typing any random alphabet and hit enter(again you won't see it on the screen),it will throw a 'command not found' error but you will have node working after this.
I am afraid these aren't exactly proper fixes, but they get the job done.
More information can be found here: https://askubuntu.com/questions/171449/shell-does-not-show-typed-in-commands-reset-works-but-what-happened/172747#172747

Starting bash like pseudo terminal with nodejs

I am developing a node cli app which starts a bash like pseudo terminal. User should be able to execute normal bash commands in that terminal like cp, cd, mkdir etc. For eg.,
dummy-linux-user:~$ my-node-cli-cmd
Bingo!
node-based-bash:~$
Tried using this package https://github.com/substack/bashful but it doesn't give autocomplete like a normal bash terminal does and it exits the node process for a command not found error. I want to show a tty like terminal to the User.
After skimming through a lot of articles and blogs I found a solution for my question in following npm packages,
https://github.com/dthree/vorpal
https://github.com/dthree/cash
Hope this findings help someone else in our wonderful community. :)

Gcloud - How to automate installation of gcloud on a server?

I want to write a shell script which basically goes through all the installation steps for gcloud, as outlined at: https://cloud.google.com/sdk/?hl=en
However, when you are run install.sh, you will be asked to enter an authorization code, your project-id, whether you want to help improve Google Cloud or not and so on. Basically user-inputs are required.
But if I want to automate the installation process on a machine where there will not be any user, how can I do this?
There are two separate problems here.
First, how do you install without prompts:
Download the google cloud sdk tar file. This can be found right under the curl command on https://cloud.google.com/sdk/
Untar and cd into the newly created directory.
run CLOUDSDK_CORE_DISABLE_PROMPTS=1 ./install.sh (or install.bat)
This disables all prompts. If you don't like the way it answers the prompts, you can pre-answer them with flags. If you preanswer all the questions, you don't need the CLOUDSDK_CORE_DISABLE_PROMPTS environment variable set. Run ./install.sh --help for a list of flags.
Now that you have it installed, how do you auth it?
If you are on GCE, you can use the credentials on the machine itself automatically. If not, some setup is required.
Since these are automated installs, you want to give them a server key. If there was a human involved, he can just proceed through the normal flow.
Keys can be downloaded from the developer console under "APIs & auth -> Credentials". Click "New credentials -> Service account key". Google recommends you use a JSON key.
When you have that key, you need to move it to the new server and run:
gcloud auth activate-service-account --key-file servicekey.json
gcloud config set project MYPROJECT
There seems to be a better / more elegant way to do this as per the docs:
curl https://sdk.cloud.google.com > install.sh
bash install.sh --disable-prompts
This sequence of commands should help:
file="google-cloud-sdk-101.0.0-linux-x86_64.tar.gz"
link="https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/"
curl -L "$link""$file" | tar xz
CLOUDSDK_CORE_DISABLE_PROMPTS=1 ./google-cloud-sdk/install.sh

PhpStorm terminal npm (node)

I've just recently started using gulp.js in my projects and I've been trying to learn and use terminal a lot more.
When I run npm commands from the mac terminal default console everything works great however when I run the same commands in PhpStorm the command is not found.
I've followed PhpStorm's guides on installing and integrating the NodeJS plugin etc but I cant seem to get any of the commands to work through it even though its in my usr/local/bin and was installed globally etc.
When I SSH to vagrant though I can use the npm commands etc. Would anyone happen to be able to suggest anything?
This one is quite old but I came across the same problem.
What I did was enter the terminal settings under tools > terminal, go to Application Settings, and change the Shell path to the one you need.
Click the ... button and select the one that suits you.

How to add a custom tool/command to tortoisehg in linux?

I am trying to trying to execute a shell command from tortiseHg. My end goal is to run a large shell command with {REV} being a parameter. Does anyone know of a way to do this?
I tried using the custom tools option in tortiseHg and it is not working for me.
No matter what I add as the command, It always returns:
The command "my command and args" could not be executed.
"No such file or directory"
Please check that the command path is valid and that it is a valid application
How to reproduce:
In tortoiseHg (linux), go to Settings> Tools > New Tool, add a new command.
Eg. touch /path/success.txt
Add tool to list
Restart thg
Click on the tool.
As lgriZdes mentioned in his answer, custom tool seems to accept only hg commands. Got around this issue by creating an alias in hg which executes a shell command, and calling this alias from custom tools. Let me know if you guys want more detailed info.
In old prehistoric versions of tortoisehg only hg commands were working. It is said here that now shell commands should work without problem How to add a custom tool/command to tortoisehg in linux?

Resources