作者fasut ()
看板Python
标题[分享]用Python程式更改macOS terminal的标题
时间Wed Sep 26 23:13:24 2018
之前用 terminal 时一直觉得如果可以快速更改 title 那该有多好
於是就花了一两天写了个 PyPI 套件,
https://pypi.org/project/termtitle/
程式码:
https://github.com/grimmer0125/terminal-title-change
上面有安装说明
使用很简单, 就打 $ termtitle 这是秘密的钢弹计划
程式码大概不到 10行吧,本来想说这麽少不好意思分享,但想说写都写了,
说不定也有人有这种功能的需求。
p.s. 其实本来还有其它想一起做的功能,但碍於时间关系就先搁着。
p.s.2 喜欢的话希望可以帮 GitHub 按赞一下
p.s.3 如果有人看到有一样功能的套件请跟我说, 我就......加入它
--
Physics is not the most important thing,
Love is.......
--
※ 发信站: 批踢踢实业坊(ptt.cc), 来自: 114.34.96.92
※ 文章网址: https://webptt.com/cn.aspx?n=bbs/Python/M.1537974810.A.0DD.html
1F:→ kenduest: 单纯 shell 下可以使用 echo -e "\033]0;Tile\007" 09/27 00:24
2F:→ kenduest: bash alias 用 setitle() { echo -e "\033]0;$1\007" ;} 09/27 00:25
3F:→ kenduest: 後续用 setitle <title> 命令方式可以进行更改 09/27 00:27
4F:→ fasut: 嗯谢谢说明, 其实我就是把这个command包起来 09/27 09:21
5F:→ TakiDog: 再加上windows吧 反正也多不了几行 09/27 11:25
6F:→ fasut: 好喔, 我想办法生出 windows 机器/系统出来 09/27 14:04
8F:→ fasut: 感恩, 刚才试了 windows的cmd, 的确打 title就可以改了 09/27 16:41
9F:→ fasut: win的powershell 要打的指令比较长一点 09/28 00:49
10F:→ fasut: [System.Console]::Title = "Running as User12345" 09/30 13:48
11F:→ uranusjr: 其实按 cmd shift i 就可以改了... 10/06 07:00