fabiospampinato / vscode-terminals

An extension for setting-up multiple terminals at once, or just running some commands.
MIT License
121 stars 19 forks source link

Characters misplaced in inputted command #86

Open aczekajski opened 7 months ago

aczekajski commented 7 months ago

I have following terminal defined which has relatively long command:

{
  "name": "storybook here",
  "command": "npm run storybook:watch -- $(winpty -Xallow-non-tty -Xplain node C:/PROJECTS/foo/some-script.mjs \"[relativeFile]\")",
  "open": "true",
  "onlySingle": "true"
},

sometimes the command is being inputted into terminal with some of the characters placed in the wrong place. In this command in most cases it's the n in -Xplain missing but sometimes some other characters are getting missing as well. The strange thing is that they're not actually missing but are being placed somewhere later in the command. Resulting command always has the same length as the one that is not malformed, but there may be like 1, 2, maybe 3 characters that are in the wrong place. It probably depends on the length of the command and maybe on the length of the prompt since one of the characters that is getting misplaced is consistently the same one.

Dunno if that helps but this is an example of misplaced characters that actually happened to me today:

// proper command with irrelevant characters replaced with underscore, showing where are the ones that got misplaced:
$ __________________________________________________________n_________________________________p________________________________n___________________________________________________________________
// example 1: first "n" and "p" got misplaced
$ __________________________________________________________________________________________________np_________________________n___________________________________________________________________
// example 2: first "n" and "p" are ok but the second "n" is misplaced
$ __________________________________________________________n_________________________________p_______________________________________________________n____________________________________________

My terminal is a git bash on windows 10.

aczekajski commented 7 months ago

99% not a problem of this extension but the general problem of vscode terminal on windows :( Described here: https://github.com/microsoft/vscode/issues/127699 If you have any idea on possibly mitigating this issue on your side, that would be awesome. If not, feel free to close this issue.