Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Silence the startup command printout in Integrated Terminal #100522

Open
mymikemiller opened this issue Jun 18, 2020 · 20 comments
Open

Silence the startup command printout in Integrated Terminal #100522

mymikemiller opened this issue Jun 18, 2020 · 20 comments
Labels
feature-request Request for new features or functionality
Milestone

Comments

@mymikemiller
Copy link
Contributor

When I run a Dart app in the Integrated Terminal, it prints out a very verbose startup command, e.g.:

cd /Users/mikem/myproject; /usr/local/Cellar/dart/2.8.2/libexec/bin/dart --enable-vm-service=0 --pause_isolates_on_start=true --write-service-info=file:///var/folders/2n/vn59_vz152vg107rrs53ympc0000gn/T/dart-vm-service-ee74.json -DSILENT_OBSERVATORY=true --enable-asserts bin/main.dart

This happens for Javascript too:

mikem@MBP node_sample % /usr/local/bin/node --inspect-brk=6018 scripts/simple.js Debugger listening on ws://127.0.0.1:6018/453abe68-1da3-4862-8ba4-71d8e3dfd8d6 For help, see: https://nodejs.org/en/docs/inspector Debugger attached.

These printouts pollute the scrollback and aren't very useful imho. Could we get an option to silence this output, so the first thing I see in the Integrated Terminal is one of the print statements actually in my code?

Note that this doesn't happen when using the Debug Console. There, I only see this printout (which also would be nice to silence, but at least it's less verbose):

Connecting to VM Service at ws://127.0.0.1:58210/4yciVJ1NsWE=/w

@weinand
Copy link
Contributor

weinand commented Jun 19, 2020

@Tyriar is there a good way to executed a command in the integrated terminal but turning off echoing?

@weinand weinand added info-needed Issue requires more information from poster debug Debug viewlet, configurations, breakpoints, adapter issues labels Jun 19, 2020
@weinand
Copy link
Contributor

weinand commented Jun 19, 2020

@mymikemiller if the debug console works for you, why are you not using it instead of the integrated terminal?

@ArturoDent
Copy link

You can turn off echoing commands in bash for example.

set +x

in your C:\Program Files\Git\etc\bash.bashrc

There is also a verbose +/-y switch in some shells. See https://stackoverflow.com/questions/2853803/how-to-echo-shell-commands-as-they-are-executed

I don't know if either of those would affect the startup commands that you are seeing?

@mymikemiller
Copy link
Contributor Author

mymikemiller commented Jun 23, 2020

@weinand The debug console doesn't accept interactive input, and also it doesn't allow me to position the cursor absolutely, which is required for a library I'm using to print out nice progress bars.

@mymikemiller
Copy link
Contributor Author

@ArturoDent I don't think this is a bash thing (I use zsh, but same thing). When I run dart bin/main.dart, my app runs without echoing any command. So this seems to be a VSCode issue.

@mymikemiller
Copy link
Contributor Author

Btw, I get the same output with bash as my default terminal as I do with zsh:

bash-3.2$ cd /Users/mikem/myproject ; /usr/local/Cellar/dart/2.8.2/libexec/bin/dart --enable-vm-service=0 --pause_isolates_on_start=true --write-service-info=file:///var/folders/2n/vn59_vz152vg107rrs53ympc0000gn/T/dart-vm-service-f583.json -DSILENT_OBSERVATORY=true --enable-asserts bin/main.dart

@mymikemiller
Copy link
Contributor Author

@ArturoDent Switching to Bash and adding set +x to the top of my .bashrc does not get rid of the printout. It does stop my bashrc from printing out any of its commands, which are printed if changed to set -x.

@weinand
Copy link
Contributor

weinand commented Jun 23, 2020

@mymikemiller are you saying that when you are typing dart bin/main.dart in zsh, you are not seeing what you are typing?

@mymikemiller
Copy link
Contributor Author

@weinand correct.

In a normal terminal:

Screen Shot 2020-06-23 at 2 09 25 PM

In VSCode's integrated terminal when debugging:

Screen Shot 2020-06-23 at 2 10 40 PM

@DanTup
Copy link
Contributor

DanTup commented Jun 24, 2020

FWIW, when debugging here - the app is being spawned with the DAP's RunInTerminalRequest request, it's not being run explicitly by manually the command in the terminal.

@weinand
Copy link
Contributor

weinand commented Jun 24, 2020

@mymikemiller your zsh echos the command you are typing. The short dart bin/main.dart command in your first screen shot corresponds to the long command in your second screen shot.

2020-06-24_16-40-19

The only difference is: VS Code creates a much longer command from data received from the dart extension because it has to make sure that the command is run in the correct directory and the environment variables are correctly set up. This result in a longer command.

VS Code does not "print out" anything here. It is your zsh that echoes the command received from VS Code.

@mymikemiller
Copy link
Contributor Author

@weinand It's not my zsh printing it, though. In the first screenshot, the text is there from me typing in the command and pressing enter. It doesn't print out the command again.

@mymikemiller
Copy link
Contributor Author

The issue also occurs when bash is my default shell:

Screen Shot 2020-06-25 at 9 50 09 AM

@weinand
Copy link
Contributor

weinand commented Jun 25, 2020

@mymikemiller in the second screenshot the text is there from VS Code typing in the command and pressing enter.

So the behavior is identically. You typing or VS Code typing makes no difference.
You don't see the text twice in the second screenshot, right?

The only difference is that VS Code has more to type.

In your initial comment on this issue you are complaining about this "printout":

cd /Users/mikem/myproject; /usr/local/Cellar/dart/2.8.2/libexec/bin/dart --enable-vm-service=0 --pause_isolates_on_start=true --write-service-info=file:///var/folders/2n/vn59_vz152vg107rrs53ympc0000gn/T/dart-vm-service-ee74.json -DSILENT_OBSERVATORY=true --enable-asserts bin/main.dart

But if you read this "printout" carefully you will find that this is not "printout" but it is the actual command that VS Code is "typing" into VS Code's Integrated Terminal. If you would type the same manually it would look identically.

@weinand weinand added *as-designed Described behavior is as designed and removed info-needed Issue requires more information from poster labels Jun 25, 2020
@mymikemiller
Copy link
Contributor Author

mymikemiller commented Jun 25, 2020

@weinand This is a feature request, though, not an issue. (I think I filed it as such)

From the initial post: "Could we get an option to silence this output, so the first thing I see in the Integrated Terminal is one of the print statements actually in my code?"

I think that's a valid request for a feature.

@weinand
Copy link
Contributor

weinand commented Jun 25, 2020

Sorry, but you called it issue:

When I run dart bin/main.dart, my app runs without echoing any command. So this seems to be a VSCode issue.

I tried to explain that this is not a VS Code issue because VS Code is not "printing" out anything.

VS Code is just "typing" a long command that starts with "cd /Users/....; bin/main.dart" into the Integrated Terminal and the shell in that terminal echos the command in the same way it is echoing when you type manually.

I will open this as a feature request.

@weinand weinand reopened this Jun 25, 2020
@weinand weinand added feature-request Request for new features or functionality and removed debug Debug viewlet, configurations, breakpoints, adapter issues *as-designed Described behavior is as designed labels Jun 25, 2020
@weinand weinand removed their assignment Jun 25, 2020
@weinand weinand added this to the Backlog milestone Jun 25, 2020
@DanTup
Copy link
Contributor

DanTup commented Jul 9, 2020

In current Insiders build, this is really noisy for NodeJS now:

Screenshot 2020-07-09 at 13 30 06

@testforstephen
Copy link

+1

We also received feedback from multiple users complaining that the startup command printed into the integrated terminal is too long when running Java application in terminal.
image

@testforstephen
Copy link

testforstephen commented Jan 28, 2021

Currently, if the start command is long, it is wrapped into multiple lines by the terminal. Users cannot quickly find the real starting point of the program output. This is the main pain point.

If the integrate terminal allows disabling the line wrapping, that will mitigate this issue too.

I found there is an existing feature request to support disabling line wrapping in integrated terminal. #74501

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request Request for new features or functionality
Projects
None yet
Development

No branches or pull requests

7 participants
@DanTup @weinand @mymikemiller @Tyriar @testforstephen @ArturoDent and others