英文:
How to get highlighted text from active terminal in VSCode Extension API
问题
我正在尝试使用VSCode API构建一个扩展,其中我需要获取用户选择的文本,无论它是在activeTextEditor
还是activeTerminal
中。我知道如何从activeTextEditor
的selection
中获取文本。然而,我无法找到从activeTerminal
中获取突出显示文本的方法。感谢任何帮助。
vscode.window.activeTerminal
英文:
I am trying to build an extension using the VSCode API in which I need to get user's selected text wherever it is either in the activeTextEditor
or activeTerminal
. I see the way of getting the text from the selection
for activeTextEditor
. However, I am not able to find a way to get the highlighted text from activeTerminal
. Appreciate any help on this.
vscode.window.activeTerminal
答案1
得分: 1
看起来没有提供相关的API。你有activeTerminal
,但没有用户选择的内容。
我找到的最接近的API请求是这个(https://github.com/microsoft/vscode/issues/47615),实际上与activeTerminal
API相关联。
所以,如果你确实需要这个功能,你应该在VS Code仓库(https://github.com/microsoft/vscode/issues/new/choose)中提出一个新的API请求,请求添加这个新的API。
希望这有所帮助。
英文:
It seems there is no API available for that. You have the activeTerminal
, but not the content the user selected.
The closer API request I found what this one (https://github.com/microsoft/vscode/issues/47615), which was in fact connected with the activeTerminal
API.
So, if you really need this feature, you should open a feature request in VS Code repo (https://github.com/microsoft/vscode/issues/new/choose) asking for this new API.
Hope this helps
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论