简体   繁体   English

在 Mac 上首次运行终端(使用 oh-my-zsh)时出现错误图标

[英]Error icon when first run terminal (using oh-my-zsh) on Mac

I always got an error when start terminal.启动终端时总是出错。 It doesn't show error message, only show icon only.它不显示错误消息,只显示图标。 I see the /var/log/system.log there is no message too.我看到/var/log/system.log也没有消息。 Here is screenshot when start terminal这是启动终端时的屏幕截图

How to see error log?如何查看错误日志? or anybody know why this error come?或者有人知道为什么会出现这个错误?

Most likely this is only a display error.这很可能只是一个显示错误。 It depends on how your theme determines the exit status of the previous command.这取决于您的主题如何确定上一个命令的退出状态。

For example, if it uses the parameter pipestatus it might lead to this problem.例如,如果它使用参数pipestatus可能会导致此问题。 pipestatus is undefined immediately after the shell starts and will only be set once a command has been run. pipestatus在 shell 启动后立即未定义,只有在运行命令后才会设置。 Should the theme only check for the exit code 0 in order to display a symbol for success, this check might fail on an undefined/empty pipestatus .如果主题只检查退出代码0以显示成功符号,则此检查可能会在未定义/空的pipestatus上失败。

The error code of the last command is also stored in the parameter ?最后一条命令的错误代码也存储在参数? (or status ). (或status )。 Unlike pipestatus ?pipestatus不同? is already defined at the shell status.已经在 shell 状态定义。 Run跑步

echo $?

as the first command after you start a terminal.作为启动终端后的第一个命令。 If it returns 0 , it would indicate that there was indeed no error.如果它返回0 ,则表明确实没有错误。

Without knowing which theme you use it is hard to tell for sure.在不知道您使用哪个主题的情况下,很难确定。


Should there indeed be an error somewhere, it would not show in /var/log/system.log .如果某处确实有错误,它不会显示在/var/log/system.log Only system services will report errors in this file.只有系统服务会报告此文件中的错误。

It's a macOS Mojave error.这是 macOS Mojave 错误。 https://forums.developer.apple.com/thread/110501 . https://forums.developer.apple.com/thread/110501 If you run cat /var/log/system.log It will show you:如果你运行cat /var/log/system.log它会告诉你:

iTerm2[28086]: DEPRECATED USE in libdispatch client: dispatch source activated with no event handler set; set a breakpoint on _dispatch_bug_deprecated to debug

Reinstall oh-my-zsh would fix this (which means a lot of work to do).重新安装 oh-my-zsh 会解决这个问题(这意味着要做很多工作)。 https://github.com/robbyrussell/oh-my-zsh https://github.com/robbyrussell/oh-my-zsh

But I think it's not a big deal, I prefer to wait for Apple fix it.但我认为这没什么大不了的,我更愿意等待 Apple 修复它。

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

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