Shell上下文

ShellContext 接口提供对当前运行的 shell 上下文的访问。您可以使用它来访问通用的 shell 选项。

InteractionMode 指示 shell 是在非交互式还是交互式模式下运行。

InteractionMode interactionMode = ctx.getInteractionMode();

Pty 指示当前终端是否具有 pty 功能,当输出管道到文件或终端在 CI 系统中运行时,情况并非如此。

boolean hasPty = ctx.hasPty();
© . This site is unofficial and not affiliated with VMware.