在Windows Terminal 集成其他程序

从命令行打开Windows Terminal

开始 - 运行 - wt 

常用快捷键

  • shift alt +,在同一个标签页横向开启一个新的命令行
  • shift alt -,在同一个标签页纵向开启一个新的命令行
  • ctrl shift w,关闭一个命令行
  • ctrl shift f,命令行搜索

.....更多的快捷键请看 文档

From <https://segmentfault.com/a/1190000023337501>

创建Profile

可以直接编辑json文件,或者使用 Settings - "Add a new profile"

配置文件说明

请访问 https://github.com/microsoft/terminal/blob/master/doc/cascadia/SettingsSchema.md

生成GUID

在https://www.guidgen.com/网站生成唯一的guid

使用当前路径

使用%__CD__%“当前工作路径”

 {

      ……

      "snapOnInput": true,

--    "startingDirectory": "%USERPROFILE%",

++    "startingDirectory": "%__CD__%",

      "useAcrylic": true

    },

C# 代码调用

使用 C# 代码启动的方法也非常常规,直接 Process.Start 然后设置工作路径即可。前提是前面设置了 %__CD__% 为启动路径。

var info = new ProcessStartInfo{

FileName = "wt.exe",

WorkingDirectory = @"D:\walterlv",

UseShellExecute = false,

};

Process.Start(info);

Kali-Linux WSL

{

                "guid": "{46ca431a-3a87-5fb3-83cd-11ececc031d2}",

                "hidden": false,

                "name": "kali-linux",

                "source": "Windows.Terminal.Wsl"

            },

            {

                "guid": "{55ca431a-3a87-5fb3-83cd-11ecedd031d2}",

                "hidden": false,

                "icon": "%USERPROFILE%\\picture\\kali-menu.png",

                "name": "Win-KeX",

                "commandline": "wsl -d kali-linux kex --esm --wtstart -s",

                "startingDirectory" : "//wsl$/kali-linux/home/test"

            },

MSYS2

            {

                "guid": "{89f3620f-f384-46f6-9681-c3d8bbeef9d5}",

                "name": "MSYS2 MinGW 64",

                "commandline": "C:\\data\\develop\\msys64\\msys2_shell.cmd -no-start -mingw64 -defterm",

                "cursorColor": "#FFFFFF",

                "cursorShape": "bar",

                "hidden": false,

                "icon": "C:\\data\\develop\\msys64\\msys2.ico",

                "fontFace": "Cascadia Code",

                "startingDirectory": "C:\\Data\\Develop\\msys64"

            }

集成 git-bash

FiraCoda 字体的下载页面:https://github.com/tonsky/FiraCode/releases

Git-Bash 下载页面:https://git-scm.com/downloads

增加Windows Terminal的配置:

{

                "guid": "{f323ab3c-9641-4904-a3a6-dc4e4992b6ae}",

                "name": "Git Bash",

                "commandline": "%programfiles%\\Git\\bin\\bash.exe --login",

                // "startingDirectory": "%userprofile%",

                "hidden": false,

                "closeOnExit": true,

                "fontFace": "Fira Code Retina",

                "fontSize": 12,

                "historySize": 9001,

                "icon": "%programfiles%\\Microsoft VS Code\\resources\\app\\extensions\\git\\resources\\icons\\git.png"

            }

集成Anaconda命令行

{
	"commandline": "%windir%\\System32\\cmd.exe \"/K\" C:\\Develop\\Anaconda\\Scripts\\activate.bat C:\\Develop\\Anaconda",
	"icon": "C:\\Develop\\Anaconda\\Menu\\anaconda-navigator.ico",
	"name": "Anaconda"
}

集成VSCode

修改VSCode的配置文件,如下:

"terminal.explorerKind": "external",

"terminal.external.windowsExec": "C:\\Users\\你的用户名\\AppData\\Local\\Microsoft\\WindowsApps\\wt.exe"

添加串口终端

参考:用Window Terminal替代PuTTY - 知乎 (zhihu.com)

https://github.com/Zhou-zhi-peng/SerialPortForWindowsTerminal.git

https://raw.githubusercontent.com/Zhou-zhi-peng/SerialPortForWindowsTerminal/main/ReleaseBin/SerialForWindowsTerminal.exe

{

                "closeOnExit": "never",

                "commandline": "C:\\Data\\Tools\\bin\\SerialForWindowsTerminal.exe",

                "icon": "C:\\Data\\Tools\\bin\\SerialForWindowsTerminal.ico",

                "name": "Serial"

            }

或者使用Putty

putty.exe [-ssh | -telnet | -rlogin | -raw] [user@]host

putty.exe telnet://host[:port]/

putty.exe -serial com1

putty.exe -load "session name"

putty -telnet -P 9696 host.name

plink -telnet -P 9696 host.name

plink login.example.com -l fred

putty.exe -serial com1 -sercfg 19200,8,n,1,N

-sercfg: specify serial port configuration

This option specifies the configuration parameters for the serial port (baud rate, stop bits etc). Its argument is interpreted as a comma-separated list of configuration options, which can be as follows:

Any single digit from 5 to 9 sets the number of data bits.

‘1’, ‘1.5’ or ‘2’ sets the number of stop bits.

Any other numeric string is interpreted as a baud rate.

A single lower-case letter specifies the parity: ‘n’ for none, ‘o’ for odd, ‘e’ for even, ‘m’ for mark and ‘s’ for space.

A single upper-case letter specifies the flow control: ‘N’ for none, ‘X’ for XON/XOFF, ‘R’ for RTS/CTS and ‘D’ for DSR/DTR.

For example, ‘-sercfg 19200,8,n,1,N’ denotes a baud rate of 19200, 8 data bits, no parity, 1 stop bit and no flow control.

集成SSH

安装Windows自带的OpenSSH后,可以直接用ssh user@ip 命令

usage: ssh [-46AaCfGgKkMNnqsTtVvXxYy] [-B bind_interface]

           [-b bind_address] [-c cipher_spec] [-D [bind_address:]port]

           [-E log_file] [-e escape_char] [-F configfile] [-I pkcs11]

           [-i identity_file] [-J [user@]host[:port]] [-L address]

           [-l login_name] [-m mac_spec] [-O ctl_cmd] [-o option] [-p port]

           [-Q query_option] [-R address] [-S ctl_path] [-W host:port]

           [-w local_tun[:remote_tun]] destination [command]

集成FTP

使用Windows自带的ftp.exe

FTP [-v] [-d] [-i] [-n] [-g] [-s:filename] [-a] [-A] [-x:sendbuffer] [-r:recvbuffer] [-b:asyncbuffers] [-w:windowsize] [host]

集成SCP

下载Portable版本的WinSCP,放到PATH中的某一个目录

WinSCP /help

也可以用Putty带的pscp.exe

Usage: pscp [options] [user@]host:source target

       pscp [options] source [source...] [user@]host:target

       pscp [options] -ls [user@]host:filespec

集成SFTP

使用Putty自带的psftp.exe

Usage: psftp [options] [user@]host

Options:

  -V        print version information and exit

  -pgpfp    print PGP key fingerprints and exit

  -b file   use specified batchfile

  -bc       output batchfile commands

  -be       don't stop batchfile processing if errors

  -v        show verbose messages

  -load sessname  Load settings from saved session

  -l user   connect with specified username

  -P port   connect to specified port

  -pw passw login with specified password

  -1 -2     force use of particular SSH protocol version

  -4 -6     force use of IPv4 or IPv6

  -C        enable compression

  -i key    private key file for authentication

  -noagent  disable use of Pageant

  -agent    enable use of Pageant

  -batch    disable all interactive prompts

工具

这里推荐一些常用工具来提高咱们工作效率。

wallhaven

wallhaven,里面全是高清壁纸,图片质量特别高,可以从这里面挑选终端的背景图

Windows Terminal Themes

在线配色工具,配色方案多到数不清

WindowsTerminalHere

WindowsTerminalHere 实现了类似git bash here 的效果,在任意文件夹右键中添加用 windows terminal 打开的功能。

安装

打开链接,下载链接里面的.inf文件,下载完成后右键下载文件,点击安装即可

gsudo

gsudo,实现了类似sudo一样的效果,解决了权限问题

安装

管理员身份运行powshell,输入以下命令

scoop install gsudo -g

安装完成后,你就能愉快的切换管理员模式了,在需要使用的命令前添加 gsudo 即可

quicklook

quicklook是一款可以快速预览文件的软件,只需要按下空格键就能快速预览文件,支持预览文件的格式非常齐全

安装

scoop install quicklook

everything

这款软件估计大部分人知道,极速检索文件

安装

scoop install everything

utools

utools 是一个极简、插件化、跨平台的现代化桌面软件。通过自由选配丰富的插件,打造你得心应手的工具集合。

通过alt+空格 ,快速呼出菜单,简单的配置就能实现快速翻译,网页快开,快速打开软件等等常用的实用功能。他的插件开发也非常简单,你通过简单的配置还能提交自己的插件

From <https://segmentfault.com/a/1190000023337501>

注:这个软件似乎要交会员费。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值