tinkerun / tinkerun-vscode

The missing way of running tinker in Visual Studio Code
https://tinke.run/vscode
MIT License
56 stars 2 forks source link

running twice in an ssh session #7

Open enyaWecurB opened 3 years ago

enyaWecurB commented 3 years ago

First of all, thank you so much for your work here - it's awesome and really super helpful! Practically, I use it all day long while programming. I'm running vscodium on unix, trying to tinker on a windows server. With my local environment it works absolutely fine, but the code is executed twice during an ssh session on the win server.

I followed your settings: "command": "ssh -i ~/.ssh/id_rsa deloyer@tinke.run -t 'cd C:/path/to/project && php artisan tinker'"

If I call this line directly from a terminal, tinker is executed remotely and no duplicates are printed (everything normal). The duplications are also shown already shifted during initialization with tinkerun, like:

Tinkerun is Initializing...
<13 -t 'cd C:/path/to/proj                                      ect/portal && php artisan tinker'ojec

Maybe there is a problem with the remote connection, like connecting twice, because the run-command works properly. IMHO. Maybe tinkerun need's the new bash '[...] php artisan tinker; bash --login'? I don't know. I'm already looking in your code, but I guess you'll find it quicker than me. hope it helps! Let me know if I can help you with further informations and thank you again for you great work.

Edit: another output with random strings - there are some duplicate lines everytime, but not always as clear to differ as here.

=> Illuminate\Support\Collection {#5088
     all: [
       "F01P6NGhc3paC7LT4BIDfyouh2BGnLQN",
       "0CTbTn79hNaBfcHcQlhoWPPw6bvMlrAi",
       "Z225MZO8qAQ1RAtlaiQAzeZlNxpFH8ku",
       "ei7GLlkoXSqpkzCTl3JG1hZW1XrCkNo1",
       "mH5sE39dLo6Pmk34X4vCpqVk7ItIPfKU",
     ],
   }
       "mH5sE39dLo6Pmk34X4vCpqVk7ItIPfKU", 
     ],
   }
billyct commented 3 years ago

@enyaWecurB I checked the code, and I think it doesn't run twice. it may be caused by the filterOutput function. it used for filtering the clear Laravel Tinker output from pty. https://github.com/tinkerun/tinkerun-vscode/blob/master/src/utils.ts#L27-L60

or caused by I have not set the cols and rows option. https://github.com/tinkerun/tinkerun-vscode/blob/master/src/terminal.ts#L110-L114

Maybe some encodings returned from the windows server are not the same as those returned by the Unix server. it's a little hard for me to testing with the windows server 🤣

https://github.com/tinkerun/tinkerun-vscode#how-to-hand-back-to-tinker-after-running-code can you try typing the Enter in the output panel, and press the Up arrow to rerun the code you last run. then check if the output is correct?

eblount commented 1 month ago

If people are encountering this, I was able to fix it by adding export TERM=xterm; before the ssh command.