microsoft / microsoft/vscode-java-debug

Provide a pseudoterminal for the running/debugging console

未关闭
#906 3 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

ai-triaged enhancement feature request terminal
主要语言
TypeScript
星标
591
派生
429
平均合并
1 天 9 小时
30 天内合并 PR
19

描述

The current default when running or debugging Java programs is to launch it in the integrated terminal, using a generated command that usually gets quite verbose. By setting java.debug.settings.console to internalConsole, users can get more clean output of their program, but the problem is that VS Code doesn't support user input from the debug console.

Therefore, it would be nice if the extension provided the option to launch a pseudoterminal for the program when running or debugging, which only shows the output of the program, and accepts user input. I think this is a much better user experience for most people, since the output of the program is what's important, not the full command used to launch it. Of course, that information may still be useful to some, and for debugging purposes, which is why I think the pseudoterminal should be just another option in java.debug.settings.console. Perhaps the pseudoterminal could be the default option, like in the Eclipse IDE:
eclipse-console

I believe implementing this should be possible using the Pseudoterminal interface by passing ExtensionTerminalOptions to vscode.window.createTerminal. Then it should just be a matter of launching the java program in the background, and redirecting it's stdin/stdout to the pseudoterminal. I would have a go at implementing it myself if I had time, but unfortunately I'm quite busy with other projects right now. If anyone has time to work on this, it would be a really nice feature to have - I've heard multiple people who want a less verbose console but who also need support for stdin.

Come to think of it, you may also be able to use createTerminal with TerminalOptions instead, but without experimenting I can't quite tell whether or not it will be able to achieve the same result as a pseudoterminal. The advantage would be that it's a little easier to implement. I'm thinking it might be possible to use the JRE path for shellPath, put the JVM and program arguments in shellArgs, and then use cwd instead of generating a cd command.

Current Result

"java.debug.settings.console": "integratedTerminal"
current-console

"java.debug.settings.console": "internalConsole"
debug-console

Expected Result

"java.debug.settings.console": "pseudoTerminal"
expected-console

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

首先定位 java.debug.settings.console 的处理逻辑以及运行/调试控制台的启动路径。阅读 issue 中引用的 VS Code PseudoterminalExtensionTerminalOptionsTerminalOptions API。当 pseudoTerminal 选项能够以干净的输出启动 Java 程序,并在运行和调试时都接受 stdin 时,即表示完成。

由索引模型根据 Issue 内容生成。

评估

技术栈
java, typescript, vscode
领域
developer-experience, devtools
Issue 类型
功能
难度
5/5
预计耗时
一周以上
活跃度
停滞
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。