windows控制台
As a Windows user, our core command line applications leave much to be desired. It isn't the easiest thing to get the perfect setup when comparing ourselves to Mac users and their beautiful Terminal application. Us Windows users usually use Windows CMD, Powershell, Cygwin, or Console2. In the last article I wrote on dev environments, I was using Cygwin and Console2.
作为Windows用户,我们的核心命令行应用程序有很多不足之处。 与Mac用户及其漂亮的Terminal应用程序进行比较时,获得完美的设置并不是最容易的事情。 我们Windows用户通常使用Windows CMD,Powershell,Cygwin或Console2。 在上一篇关于开发环境的文章中 ,我使用的是Cygwin和Console2。
One of the downsides (for me) of using Cygwin was that I'd have to have everything in the cygwin folder that was created in the C: drive.
使用Cygwin的缺点(对我而言)之一是,我必须将所有内容保存在C:驱动器中创建的cygwin文件夹中。
Now I've moved onto a couple other tools. With my new setup, I can just fire up a console and be in the folder where all my projects are stored. I've landed on a few things for my development environment and I need all of them to work together.
现在,我已经使用了另外两个工具。 通过新设置,我可以启动一个控制台并将其保存在存储所有项目的文件夹中。 我为开发环境着手了一些东西,我需要所有这些东西一起工作。
我使用的工具 (Tools I Use)
好处 (Benefits)
- Use a console in my directory where I hold all my projects (not that cygwin folder) 在我存放所有项目的目录中使用控制台(不是该cygwin文件夹)
- Haved access to all the normal CMD commands and more 可以访问所有正常的CMD命令等等
- Use Linux like commands
cd,ls, etc. anywhere in the Windows filesystem 在Windows文件系统中的任何地方使用Linux之类的命令cd,ls等命令 - Control Vagrant, Node, Git, SSH, and whatever else you need 控制Vagrant,Node,Git,SSH以及您需要的任何其他功能
- Have it look pretty 看起来很漂亮
- Have tabs 有标签
Let's dive in and see how this setup works. Hopefully you can take from it and be able to adjust it for your own purposes.
让我们深入研究一下此设置的工作原理。 希望您可以从中受益,并能够针对自己的目的进行调整。
安装一切 (Install Everything)
Download and install the items above. Git Bash and ConEmu are the big ones. You can download and install Node and Vagrant at a later time if you want to use those.
下载并安装上述项目。 Git Bash和ConEmu是最重要的。 如果要使用它们,可以在以后的时间下载并安装Node和Vagrant。
安慰 ( Console)
We will use Git Bash for our console. This comes bundled with the Linux-like commands we want, SSH, and of course Git. We use this instead of the default CMD or Powershell that comes with Windows since it also gives us SSH. You could install Putty and use SSH from there, but it's just so much cooler to do it from the command line.
我们将在控制台中使用Git Bash 。 它与我们想要的类似Linux的命令,SSH以及Git捆绑在一起。 我们使用它来代替Windows附带的默认CMD或Powershell,因为它也为我们提供了SSH。 您可以安装Putty并从那里使用SSH,但是从命令行执行它要酷得多。
Download and install that and that will install into your Program Files/Program Files (x86) depending on your system.
下载并安装该Program Files/Program Files (x86) ,然后将其安装到您的Program Files/Program Files (x86)具体取决于您的系统。
This will give you access to Git from the Windows Command Prompt. The main reason I do this is because the Sublime Text Git Plugin needs to be able to use Git from the Windows Command Prompt. If you don't need that functionality, then it doesn't really matter which you choose.
这将使您可以从Windows命令提示符访问Git。 我这样做的主要原因是因为Sublime Text Git插件需要能够使用Windows命令提示符中的Git。 如果您不需要该功能,那么选择哪一个都不重要。
You can start up Git Bash after it's installed and you'll get a nice little console window. You can run all your commands from there and you could completely stop right there and be content. But we always want better. We want tabs, the ability to make the window larger, transparency, full screen, and more to make our console as cool as our Mac brethen and their Terminal.
您可以在安装Git Bash后启动它,然后会看到一个漂亮的控制台窗口。 您可以从那里运行所有命令,然后就可以完全停在那里并获得满足。 但是我们总是想要更好。 我们需要选项卡,使窗口变大的功能,透明的功能,全屏显示以及更多功能,以使我们的控制台像Mac brethen及其终端一样酷。
Next we'll install a console emulator that will sit on top of Git Bash. It will provide us the cool features we want.
接下来,我们将安装一个控制台模拟器,它将位于Git Bash之上。 它将为我们提供我们想要的出色功能。
控制台模拟器 ( Console Emulator)
Downloading and installing ConEmu is the easy part. Getting it setup can be a little daunting since there are so many options.
下载和安装ConEmu很容易。 因为有很多选择,所以设置它可能有点令人生畏。
We'll go through each of the important settings pages and you can tweak things from there.
我们将浏览每个重要的设置页面,您可以从那里进行调整。
ConEmu设置 (ConEmu Settings)
任务和启动 (Tasks and Startup)
These are the big settings and we'll get them out of the way first. A task is the program that you want to use with ConEmu. You can set up multiple programs like, Windows CMD, Windows Powershell, or in our case, Git Bash.
这些是重要的设置,我们将首先消除它们。 任务是您要与ConEmu一起使用的程序。 您可以设置多个程序,例如Windows CMD,Windows Powershell,或者在我们的示例中为Git Bash 。
windows +
windows +
alt +
alt +
p will get you there.
p将带您到达那里。
设置Git Bash任务 (Setup Git Bash Task)
We're going to create a new task named Git. We can also change our starting directory so whenever you start that task, it will open up there. I like putting all my projects into a "batcave" folder in my Documents. C:UsersChrisDocumentsbatcave.
我们将创建一个名为Git的新任务。 我们还可以更改我们的启动目录,以便每当您启动该任务时,它将在此处打开。 我喜欢将我的所有项目都放在文档的“ batcave”文件夹中。 C:UsersChrisDocumentsbatcave 。
We are also going to set the program that will open up, Git Bash. We installed this into our Program Files directory so we'll access it there. The --login -i modifiers grant the program access to our user info so we can run commands like ssh-keygen and generate items into our User folder. (don't quote me on that. I saw it in a forum post a long time ago and it worked, so I ran with it. If anyone can clarify in the comments that'd be great!)
我们还将设置将打开的程序Git Bash 。 我们将其安装到Program Files目录中,以便在那里访问它。 --login -i修饰符授予程序访问我们用户信息的权限,因此我们可以运行ssh-keygen类的命令并在User文件夹中生成项目。 (不要在此引用我的名字。很久以前我在论坛上看到它,并且它起作用了,所以我同意了。如果有人可以在评论中阐明它,那就太好了!)
启动 (Startup)
We want our console to automatically start with Git Bash. So in startup, set Specified name task to {Git}. Now whenever we open it up, we'll have a console window in our chosen directory and ready to go.
我们希望我们的控制台自动从Git Bash开始。 因此,在启动时,将“ 指定名称”任务设置为{Git}。 现在,每次打开它时,我们都会在所选目录中有一个控制台窗口,可以开始使用了。
Let's move on to the smaller settings.
让我们继续进行较小的设置。
主要设定 (Main Settings)
The main things you want to look at here is Font. For Windows 8 (and I believe 7), you'll want to turn on Clear Type for antialiasing to make the fonts look smoother. You can also play around with different fonts. Some of my favorites are * Consolas * Ubuntu Mono * Source Code Pro
您要在这里查看的主要内容是Font 。 对于Windows 8(我相信是7),您需要打开Clear Type进行抗锯齿,以使字体看起来更平滑。 您也可以使用不同的字体。 我最喜欢的一些是* Consolas * Ubuntu Mono * Source Pro
You can also set a background image. This isn't exactly my cup of tea, but I'm sure some people will like it, especially after you tweak some settings and font colors.
您还可以设置背景图像 。 这不完全是我的理想之选,但是我敢肯定有些人会喜欢它,尤其是在您调整了一些设置和字体颜色之后。
大小和位置 (Size & Pos)
Auto save window size and position on exit: This setting is useful. I like windows to open up where I last closed them. You can also turn this setting to go Normal, Maximized, and Full Screen. I prefer to keep this Normal and then move the window around.
Pad size: This is the size of the padding around your console. By default, the text will hug right up to the border. This makes things a little nicer looking.
自动保存窗口大小和退出位置:此设置很有用。 我喜欢在最近关闭窗户的地方打开窗户。 您也可以将此设置转到“ Normal ,“ Maximized ”和Full Screen 。 我更喜欢保持此“正常”状态,然后再移动窗口。
填充大小:这是控制台周围的填充大小。 默认情况下,文本将紧靠边框。 这使外观看起来更好看。
出现 (Appearance)
Hide caption always Checking this box removes the toolbar with the minimize, maximize, and close buttons. You can change this based on your own preference. I like to make this as clean as possible.
始终隐藏标题选中此框将删除带有最小化,最大化和关闭按钮的工具栏。 您可以根据自己的喜好进行更改。 我喜欢使它尽可能干净。
ctrl +
ctrl +
alt will allow you to drag the window.
alt将允许您拖动窗口。
透明度 (Transparency)
Turn on and adjust to your liking. This I think adds a great deal of that cool factor.
打开并根据自己的喜好进行调整。 我认为这增加了很多很酷的因素。
标签 (Tabs)
I set these to Auto show. So when you have only one tab open, you get a very clean console. It's a little hard to move it around and you're gonna need keyboard shortcuts to maximize or get to the settings, but it's so pretty!
我将这些设置为“ 自动显示” 。 因此,当您仅打开一个选项卡时,您将获得一个非常干净的控制台。 移动它有点困难,并且您将需要键盘快捷键来最大化或获取设置,但是它是如此的漂亮!
windows +
windows +
alt +
alt +
p.
p 。
windows +
windows +
w.
w 。
状态栏 (Status bar)
I've never really found a use for it so I turn it off.
我从来没有真正找到它的用途,所以我将其关闭。
Those are my main settings to get down to a barebones console. Play around with all those settings to your heart's content. You could do some cool things with colors and all those other settings that I really need to dig into.
这些是我进入准系统控制台的主要设置。 尽情享受所有这些设置。 您可以使用颜色以及我确实需要深入研究的所有其他设置来做一些很酷的事情。
色彩 (Colors)
This is pretty neat. You can change out the basic colors of your console. Just play with colors -> schemes and see what works best for you.
这很整齐。 您可以更改控制台的基本颜色。 只需玩颜色->方案 ,看看最适合您的方案。
向前走 (Going Forward)
Go ahead and install Node, Vagrant, and any other tools you use in your daily workflow. If they are accessible from Windows CMD and Powershell, they will be accessible from this new setup. (as long as they are added to the PATH environment variable in Windows).
继续并安装Node , Vagrant和您在日常工作流程中使用的任何其他工具。 如果可以从Windows CMD和Powershell访问它们,则可以通过此新设置访问它们。 (只要将它们添加到Windows中的PATH环境变量中)。
Let me know if you have any questions or need help setting anything specific up. I know I didn't really touch on getting Vagrant setup or Node or any other big tools so far. Enjoy and happy console-ing!
如果您有任何疑问或需要帮助,请告诉我。 我知道到目前为止,我并没有真正接触过Vagrant的安装程序或Node或任何其他大型工具。 享受快乐的控制台!
翻译自: https://scotch.io/tutorials/get-a-functional-and-sleek-console-in-windows
windows控制台
本文介绍如何在Windows环境下,利用GitBash、ConEmu等工具搭建一个功能强大且美观的开发控制台,实现类似Mac Terminal的体验,包括自定义启动目录、Linux命令、多标签等功能。






532

被折叠的 条评论
为什么被折叠?



