简体   繁体   English

谁能解释Git Bash和VS Code Integrated Terminal(bash)之间的区别?

[英]Can anybody explain the difference between Git Bash and VS Code Integrated Terminal (bash)?

I'm creating my own script and add the following line to ".bash_profile": 我正在创建自己的脚本,并将以下行添加到“ .bash_profile”:

source D:/PROJECTs/Terminal/mixkie

However, it worked in Git Bash but it didn't work in VSCode Integrated Terminal. 但是,它可以在Git Bash中使用,但不能在VSCode Integrated Terminal中使用。 Does anybody know why? 有人知道为什么吗?

Screenshot of my attempt to run my script: 我尝试运行脚本的屏幕截图: 我尝试运行脚本的屏幕截图

Screenshot of my attempt to print color text in Python: 我尝试在Python中打印彩色文本的屏幕截图: 我尝试在Python中打印彩色文本的屏幕截图

One of your shell processes most likely has . 您的shell进程之一很可能具有. in its PATH , which makes it look for executables in the current working directory. 在其PATH ,这使它可以在当前工作目录中查找可执行文件。 This is traditional on DOS, where it's even implicit, but avoided on multiuser Unix type systems, because it could lead to executing programs created by some other user by mistake. 这在DOS上是传统的,甚至是隐式的,但在多用户Unix类型的系统上却避免了,因为它可能导致执行其他用户错误创建的程序。 The source command ought to work either way, since it specifies the path, and you can use commands like ./mixkie as well. 源命令应该以任何一种方式工作,因为它指定了路径,并且您也可以使用./mixkie命令。

The colour issue is using ANSI style escape sequences, and one of your terminals simply didn't parse them. 颜色问题是使用ANSI样式转义序列,而您的终端之一根本没有解析它们。 By the prompt above, it does have the capability, so I don't know why that would be. 根据上面的提示,它确实具有该功能,所以我不知道为什么会这样。 The curses module provides library functions that can generate such sequences according to the terminal you're using; curses模块提供的库函数可以根据您所使用的终端生成此类序列。 it could be it has another set. 可能还有另外一套。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM