Change:
Hi :) I would love to be able to use to send snippets of code to my terminal. I am developing all the time interactively with editing a file and fiddling in a REPL (in integrated Terminal) alongside, where I have my environment loaded. I edit a function, I load the file from the REPL, and then test it interactively. The difference to is that I have state in the REPL. This then can be used for different languages with a simple configuration. I have written a for this feature, and I will write a Extension, according to your response. Thanks for reading, and keep up the good work
any tips on leveraging task code to resolve this?
Let me make sure I understand the request: set up your REPL with some state run the command above using your keybinding which causes the file you want to test to be loaded into the REPL. then want to run preset snippets of code in the REPL. This is the part where you want to use tasks variables to send preset code snippets to the REPL. Is all that correct? If so, I think this can be accomplished with tasks in insiders. There is now a third type; . I think you could use this to accomplish step three above by having a few different input types that use the command and has the snippet you want as an argument. You would need a separate task + input variable for each snippet, I can't think of a way around that unless you write a simple extension. You might need to make your task or . I'm not sure how will interact with the active terminal being one used by tasks.
the commands lets you send data to any terminal (not just task ones), it basically lets users fake typing in without building an extension to do it. For example you could send ctrl+c or "ls" then enter. The request is just about supporting resolving the syntax as used within tasks in the command. The example keybinding: Could be used to 'source' (run) the active file in the active terminal. I mainly wanted to code pointer to where this variable resolution happens in tasks and/or debug so that a contributor could put a PR together and share the code.
Variables are resolved here:
I'd love to help by implementing this feature if you guys would want me to :) I think we need to handle in code of itself or is there any other way round?
you'll probably need to call this similar to how it's called on the environment: And yes in the code for the sendSequence action.
you wanna work over this or can I take it?
Great ! You can take it.
This is a fairly simple task, and to implements this, I need to resolve (variables like ${file}, etc) the before passing it to in function. I have a question, To resolve a I need to have an object of class or something that simply extends . How do I instantiate or pass such object to function? ping
you can use our dependency injection system like in this command:
That works for classes which extend , I could not find such usage for some class which extends . Probably It is because how the are registered:
I think you should be able to convert it to an ?
I thought exactly the same!! But could not find an example of an that takes something like . Will do it if you could give some pointer to such specs.
ah I see, I guess that's why it's a :smiley: Looks like a is passed into , you should be able to grab the service off that like this:
It's working!! Should auto completion be implemented? If yes, how do we kick in auto suggestions in ?
great! I've never done that before so I'm not sure, also not sure if we support doing that in other keybindings (in which case it'd be a bunch of work). Let's do a PR without it to start with
Works like a charm in . I have another edge case question concerning the feature, more about haw the task variables are resolved. Don't expect an answer, and hope it is OK to ask here. On Windows is , but is . Is there a way to influence the path seperator ( vs ) ?
no there isn't a way to influence the path separators. is the issue related to this.

Discussion:
import { timeout } from 'vs/base/common/async'; import { FindReplaceState } from 'vs/editor/contrib/find/findState'; import { ISelectOptionItem } from 'vs/base/browser/ui/selectBox/selectBox'; <ins> import { IConfigurationResolverService } from 'vs/workbench/services/configurationResolver/common/configurationResolver'; import { IHistoryService } from 'vs/workbench/services/history/common/history'; import { Schemas } from 'vs/base/common/network'; </ins> import { URI } from 'vs/base/common/uri'; export const TERMINAL_PICKER_PREFIX = 'term ';

if (!terminalInstance) { return; } <del> terminalInstance.sendText(args.text, false); </del> <ins> const configurationResolverService = accessor.get(IConfigurationResolverService); const workspaceContextService = accessor.get(IWorkspaceContextService); const historyService = accessor.get(IHistoryService); const activeWorkspaceRootUri = historyService.getLastActiveWorkspaceRoot(Schemas.file); const lastActiveWorkspaceRoot = activeWorkspaceRootUri ? workspaceContextService.getWorkspaceFolder(activeWorkspaceRootUri) : null; const resolvedText = configurationResolverService.resolve(lastActiveWorkspaceRoot, args.text); terminalInstance.sendText(resolvedText, false); </ins> } }