Skip to content

Every time you press F5, the selection environment will pop up #4539

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

Closed
HanHan666666 opened this issue Nov 22, 2021 · 11 comments
Closed

Every time you press F5, the selection environment will pop up #4539

HanHan666666 opened this issue Nov 22, 2021 · 11 comments
Milestone

Comments

@HanHan666666
Copy link

HanHan666666 commented Nov 22, 2021

Pressing the F5 key does not directly start debug. Instead, the select environment prompt box appears every time.
动画

sudo docker run -d \
  --name=code-server \
  -e PUID=1000 \
  -e PGID=1000 \
  -e PASSWORD=password \
  -e SUDO_PASSWORD=0415oo \
  -e PROXY_DOMAIN=linuxserver.666baby.com  \
  -p 8443:8443 \
  -v /path/to/appdata/config:/config \
  --restart unless-stopped \
linuxserver/code-server

apache config

<VirtualHost *:80>
    ServerAdmin [email protected]
    DocumentRoot "/www/wwwroot/code.666baby.com/linuxserver.666baby.com"
    ServerName fd96025a.linuxserver.666baby.com
    ServerAlias linuxserver.666baby.com
    #errorDocument 404 /404.html
    ErrorLog "/www/wwwlogs/linuxserver.666baby.com-error_log"
    CustomLog "/www/wwwlogs/linuxserver.666baby.com-access_log" combined
    #HTTP_TO_HTTPS_START
    <IfModule mod_rewrite.c>
        RewriteEngine on
        RewriteCond %{SERVER_PORT} !^443$
        RewriteRule (.*) https://%{SERVER_NAME}$1 [L,R=301]
    </IfModule>
    #HTTP_TO_HTTPS_END
    
    #DENY FILES
     <Files ~ (\.user.ini|\.htaccess|\.git|\.svn|\.project|LICENSE|README.md)$>
       Order allow,deny
       Deny from all
    </Files>
    
    #PHP
    <FilesMatch \.php$>
            SetHandler "proxy:unix:/tmp/php-cgi-00.sock|fcgi://localhost"
    </FilesMatch>
    
    #PATH
    <Directory "/www/wwwroot/code.666baby.com/linuxserver.666baby.com">
        SetOutputFilter DEFLATE
        Options FollowSymLinks
        AllowOverride All
        Require all granted
        DirectoryIndex index.php index.html index.htm default.php default.html default.htm
    </Directory>
</VirtualHost>
<VirtualHost *:443>
    ServerAdmin [email protected]
    DocumentRoot "/www/wwwroot/code.666baby.com/linuxserver.666baby.com/"
    ServerName SSL.linuxserver.666baby.com
    ServerAlias linuxserver.666baby.com 
    #errorDocument 404 /404.html
    ErrorLog "/www/wwwlogs/linuxserver.666baby.com-error_log"
    CustomLog "/www/wwwlogs/linuxserver.666baby.com-access_log" combined
    
     RewriteEngine On
	ProxyRequests On
	ProxyVia On
	# Proxy Traffic
	RewriteCond %{HTTP:Upgrade} =websocket
        RewriteRule /(.*)           ws://localhost:8443/$1 [P,L]
        RewriteCond %{HTTP:Upgrade} !=websocket
        RewriteRule /(.*)           http://localhost:8443/$1 [P,L]
    
    #SSL
    SSLEngine On
    SSLCertificateFile /www/server/panel/vhost/cert/linuxserver.666baby.com/fullchain.pem
    SSLCertificateKeyFile /www/server/panel/vhost/cert/linuxserver.666baby.com/privkey.pem
    SSLCipherSuite EECDH+CHACHA20:EECDH+CHACHA20-draft:EECDH+AES128:RSA+AES128:EECDH+AES256:RSA+AES256:EECDH+3DES:RSA+3DES:!MD5
    SSLProtocol All -SSLv2 -SSLv3 -TLSv1
    SSLHonorCipherOrder On
    
    
    #PHP
    <FilesMatch \.php$>
            SetHandler "proxy:unix:/tmp/php-cgi-00.sock|fcgi://localhost"
    </FilesMatch>
    

    #DENY FILES
     <Files ~ (\.user.ini|\.htaccess|\.git|\.svn|\.project|LICENSE|README.md)$>
       Order allow,deny
       Deny from all
    </Files>

    #PATH
    <Directory "/www/wwwroot/code.666baby.com/linuxserver.666baby.com/">
        SetOutputFilter DEFLATE
        Options FollowSymLinks
        AllowOverride All
        Require all granted
        DirectoryIndex index.php index.html index.htm default.php default.html default.htm
    </Directory>
</VirtualHost>

In the code-server terminal
sudo apt install gcc g++ gdb

Install cpptools form https://github.com/microsoft/vscode-cpptools/releases/tag/1.7.1
Version 3.11.1 does not have this problem,Version 3.11.1 does not have this problem, it seems to be the bug that appeared since 3.12.0.
Test url:https://linuxserver.666baby.com/
password: password

@zhouym233
Copy link

zhouym233 commented Nov 22, 2021

I met same problem.
By the way, it is similar to issue #4221

@jsjoeio
Copy link
Contributor

jsjoeio commented Nov 22, 2021

Hmm...maybe that's what the keybinding is bound to in the browser? You can take a look by going to:

  1. Command Palette > Open Keyboard Shorcuts
  2. Click the keyboard icon on the right
    image
  3. Hit F5 and see what it says

If I had to make a guess, my bet would be that it doesn't know which environment you're debugging in so it asks you to select it each time. Maybe if it were saved to a launch.json (I think that's it), then that would fix this?

@jsjoeio jsjoeio added the waiting-for-info Waiting for more information from submitter label Nov 22, 2021
@HanHan666666
Copy link
Author

Hmm...maybe that's what the keybinding is bound to in the browser? You can take a look by going to:

  1. Command Palette > Open Keyboard Shorcuts
  2. Click the keyboard icon on the right
    image
  3. Hit and see what it saysF5

If I had to make a guess, my bet would be that it doesn't know which environment you're debugging in so it asks you to select it each time. Maybe if it were saved to a (I think that's it), then that would fix this?launch.json

Thank you for your reply. I looked at the keyboard shortcut and it is the same as the vscode Windows client, also I found that the python file has the same problem.
code-server
vscode Windows client
python
This is the launch.json file before the python configuration was added.

{
    // Use IntelliSense to learn about possible attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
      
        {
            "name": "gcc - Build and debug active file",
            "type": "cppdbg",
            "request": "launch",
            "program": "${fileDirname}/${fileBasenameNoExtension}",
            "args": [],
            "stopAtEntry": false,
            "cwd": "${fileDirname}",
            "environment": [],
            "externalConsole": false,
            "MIMode": "gdb",
            "setupCommands": [
                {
                    "description": "Enable pretty-printing for gdb",
                    "text": "-enable-pretty-printing",
                    "ignoreFailures": true
                }
            ],
            "preLaunchTask": "C/C++: gcc build active file",
            "miDebuggerPath": "/usr/bin/gdb"
        }
    ]
}

This is the launch.json file with the python configuration added.

{
    // Use IntelliSense to learn about possible attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Python: Current File",
            "type": "python",
            "request": "launch",
            "program": "${file}",
            "console": "integratedTerminal"
        },
        {
            "name": "gcc - Build and debug active file",
            "type": "cppdbg",
            "request": "launch",
            "program": "${fileDirname}/${fileBasenameNoExtension}",
            "args": [],
            "stopAtEntry": false,
            "cwd": "${fileDirname}",
            "environment": [],
            "externalConsole": false,
            "MIMode": "gdb",
            "setupCommands": [
                {
                    "description": "Enable pretty-printing for gdb",
                    "text": "-enable-pretty-printing",
                    "ignoreFailures": true
                }
            ],
            "preLaunchTask": "C/C++: gcc build active file",
            "miDebuggerPath": "/usr/bin/gdb"
        }
    ]
}

tasks.json

{
    "tasks": [
        {
            "type": "cppbuild",
            "label": "C/C++: gcc build active file",
            "command": "/usr/bin/gcc",
            "args": [
                "-fdiagnostics-color=always",
                "-g",
                "${file}",
                "-o",
                "${fileDirname}/${fileBasenameNoExtension}"
            ],
            "options": {
                "cwd": "${fileDirname}"
            },
            "problemMatcher": [
                "$gcc"
            ],
            "group": {
                "kind": "build",
                "isDefault": true
            },
            "detail": "Task generated by Debugger."
        },
        
    ],
    "version": "2.0.0"
}

@jsjoeio
Copy link
Contributor

jsjoeio commented Nov 23, 2021

Hmm...strange 🤔 Well thank you for the thorough reply and code snippets. We'll need to investigate this further

@jsjoeio jsjoeio added needs-investigation This issue needs to be further investigated and removed waiting-for-info Waiting for more information from submitter labels Nov 23, 2021
@jsjoeio jsjoeio added this to the Backlog milestone Nov 23, 2021
@Olderdriver
Copy link

I met the same problem today.
My codeserver was running in docker with reverse http proxy

@HanHan666666
Copy link
Author

I met the same problem today.
My codeserver was running in docker with reverse http proxy

Yes, me too.

@D1ngkai
Copy link

D1ngkai commented Dec 7, 2021

I met the same problem today.
My codeserver was running in docker with reverse http proxy

Me too.

@ls84
Copy link

ls84 commented Jan 5, 2022

I have same problem with python debugger, i tried docker release and standalone release on ubuntu, both without any proxy. reverted back to 3.11.1, there were no problem

@Olderdriver
Copy link

Olderdriver commented Jan 6, 2022 via email

@jsjoeio
Copy link
Contributor

jsjoeio commented Jan 7, 2022

Can someone test this on 4.0.1 and let us know if it's still an issue?

@HanHan666666
Copy link
Author

Many thanks to the developers for their efforts, I tested it on version 4.0.1 and didn't find this bug, it's just like using the desktop client, it's perfect.

@code-asher code-asher removed the needs-investigation This issue needs to be further investigated label Jul 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants