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

时间:2017-11-19 15:47:11

标签: macos terminal oh-my-zsh

启动终端时总是出错。它不显示错误消息,仅显示图标。我看到/var/log/system.log也没有消息。 Here is screenshot when start terminal

如何查看错误日志?或任何人都知道为什么会出现这个错误?

2 个答案:

答案 0 :(得分:0)

这很可能只是显示错误。这取决于主题如何确定上一个命令的退出状态。

例如,如果它使用参数pipestatus,则可能会导致此问题。 在shell启动后立即定义pipestatus,并且只有在命令运行后才会设置0。如果主题仅检查退出代码pipestatus以显示成功的符号,则此检查可能会在未定义/空?上失败。

最后一个命令的错误代码也存储在参数status(或pipestatus)中。与? echo $? 不同,已在shell状态中定义。运行

0

作为启动终端后的第一个命令。如果它返回/var/log/system.log,则表示确实没有错误。

在不知道您使用哪种主题的情况下,很难确定。

如果某处确实存在错误,则不会在@Entity(value = "cb-homes", noClassnameStored = true) @Getter @Setter @ToString public class DatastoreHome extends DatastoreEntity { @Id private ObjectId id; @Indexed(options = @IndexOptions(unique = true, sparse = true, background = true)) private UUID uniqueId; @Property("homes") @Embedded private Map<String, List<HomeLocation>> homeLocations; public List<String> getHomeNameList() { List<HomeLocation> locations = homeLocations.get(Bukkit.getServerName()); if(locations == null) { locations = new ArrayList<>(); homeLocations.put(Bukkit.getServerName(), locations); } return locations.stream().map(HomeLocation::getHomeName).collect(Collectors.toList()); } public List<Location> getHomeLocationList() { List<HomeLocation> locations = homeLocations.get(Bukkit.getServerName()); if(locations == null) { locations = new ArrayList<>(); homeLocations.put(Bukkit.getServerName(), locations); } return locations.stream().map(HomeLocation::getLocation).collect(Collectors.toList()); } public boolean hasSetBaseHome() { return getHomeLocation("home") != null; } public Location getBaseHomeLocation() { return getHomeLocation("home"); } public Location getHomeLocation(String homeName) { List<HomeLocation> locations = homeLocations.get(Bukkit.getServerName()); if(locations == null) { locations = new ArrayList<>(); homeLocations.put(Bukkit.getServerName(), locations); } return locations.stream() .filter(location -> location.getHomeName().equals(homeName.toLowerCase())) .findAny() .map(HomeLocation::getLocation) .filter(location -> location.getWorld().getName() != "world") .orElse(null); } public boolean isHomeAlreadySet(String name) { return getHomeNameList().contains(name.toLowerCase()); } public HomeLocation addHomeLocation(String homeName, Location location) { List<HomeLocation> locations = homeLocations.get(Bukkit.getServerName()); if(locations == null) { locations = new ArrayList<>(); homeLocations.put(Bukkit.getServerName(), locations); } if(isHomeAlreadySet(homeName)) { locations.remove(getHomeLocation(homeName)); } HomeLocation homeLocation = new HomeLocation(); homeLocation.setHomeName(homeName.toLowerCase()); homeLocation.setLocation(location); homeLocations.get(Bukkit.getServerName()).add(homeLocation); return homeLocation; } public void removeBaseHomeLocation() { removeHomeLocation("home"); addHomeLocation("home", new Location(Bukkit.getWorld("world"), 0, 0, 0, 0, 0)); } public boolean removeHomeLocation(String homeName) { if(homeLocations.get(Bukkit.getServerName()) == null) { homeLocations.put(Bukkit.getServerName(), new ArrayList<>()); } return homeLocations.get(Bukkit.getServerName()).removeIf(location -> location.getHomeName().equals(homeName)); } static { datastore.ensureIndexes(DatastoreHome.class); } } 中显示。只有系统服务才会报告此文件中的错误。

答案 1 :(得分:0)

这是macOS Mojave错误。 https://forums.developer.apple.com/thread/110501。如果您运行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

重新安装oh-my-zsh可以解决此问题(这意味着需要做很多工作)。 https://github.com/robbyrussell/oh-my-zsh

但是我认为这没什么大不了的,我宁愿等待苹果公司对其进行修复。