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.