Java终端模式小尝试

编程入门 行业动态 更新时间:2024-10-25 00:30:30

Java<a href=https://www.elefans.com/category/jswz/34/1771374.html style=终端模式小尝试"/>

Java终端模式小尝试

Java终端模式小尝试

  • 1、IDE中终端
    • 1.1 拉去代码 jediterm
    • 1.2 IDE调用系统终端
  • 2、待续~~

1、IDE中终端

终端_Intellij IDEA、Terminal emulator | pycharm Documentation
JetBrains jediterm
WindTerm:新一代开源免费的终端工具,GitHub星标6.6k+,太酷了! ()

1.1 拉去代码 jediterm

克隆失败,只能下载导入-_-

1.2 IDE调用系统终端

com/jediterm/app/JediTermMain.kt 在Windows使用"powershell.exe"

  override fun createTtyConnector(): TtyConnector {try {val envs: Map<String, String> = configureEnvironmentVariables()val command: Array<String> = if (Platform.current() == Platform.Windows) {arrayOf("powershell.exe")}else {val shell = envs["SHELL"] ?: "/bin/bash"if (Platform.current() == Platform.Mac) arrayOf(shell, "--login") else arrayOf(shell)}val workingDirectory = Path.of(".").toAbsolutePath().normalize().pathStringLOG.info("Starting ${command.joinToString()} in $workingDirectory")val process = PtyProcessBuilder().setDirectory(workingDirectory).setInitialColumns(120).setInitialRows(20).setCommand(command).setEnvironment(envs).setConsole(false).setUseWinConPty(true).start()return LoggingPtyProcessTtyConnector(process, StandardCharsets.UTF_8, command.toList())}catch (e: Exception) {throw IllegalStateException(e)}}

2、待续~~

更多推荐

Java终端模式小尝试

本文发布于:2023-11-15 04:29:14,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1593659.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:终端   模式   Java

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!