简体   繁体   English

从命令行检测OSX终端颜色设置

[英]Detect OSX Terminal Color Settings from the Command Line

In Mac OSX, one can change properties of the terminal via editor. 在Mac OSX中,可以通过编辑器更改终端的属性。 These properties include text color, background color, and highlight color. 这些属性包括文本颜色,背景颜色和突出显示颜色。

How can I detect what these properties have been set to for the terminal currently being used? 如何检测当前正在使用的终端的这些属性设置?

Is there some cache or file within "/Applications/Utilities/Terminal.app/Contents/Resources" that holds this information? 在“ /Applications/Utilities/Terminal.app/Contents/Resources”中是否有一些缓存或文件保存此信息?

Thank you. 谢谢。

While you can find preferences as files , the actual colors which are used are in the Terminal application's memory . 虽然你可以找到偏好 文件 ,这些文件 使用的实际颜色在终端应用程序的内存

Other applications may be able to ask the terminal for this information, eg, using escape sequences. 其他应用程序可能能够例如使用转义序列向终端请求此信息。

Terminal.app does not recognize the xterm control sequences that would return this information, nor does it (from review/reading) apparently support analogous escape sequences. Terminal.app无法识别将返回此信息的xterm控制序列,它(从审阅/阅读中)也显然不支持类似的转义序列。

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

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