-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
python.terminal.executeInFileDir doesn't seem to have any effect #1062
Comments
settings.json: {
// "editor.fontFamily": "Consolas, 'Courier New', monospace",
"editor.fontFamily": "Verdana",
// "editor.fontSize": 16,
"terminal.integrated.fontFamily": "Consolas",
"editor.suggestOnTriggerCharacters": false,
"editor.acceptSuggestionOnEnter": "off",
"editor.find.autoFindInSelection": true,
"python.formatting.provider": "none",
"python.linting.enabled": false,
"python.terminal.executeInFileDir": true,
"files.autoSave": "off",
"files.trimTrailingWhitespace": true,
"files.insertFinalNewline": true,
"editor.renderWhitespace": "none",
"editor.renderControlCharacters": false,
"editor.renderLineHighlight": "all",
"editor.rulers": [80],
"editor.autoClosingBrackets": false,
"editor.minimap.showSlider": "always",
"editor.cursorStyle": "line-thin",
"workbench.colorTheme": "Solarized Dark",
"workbench.colorCustomizations": {
"editorCursor.foreground": "#44ffaacc",
"editor.selectionBackground": "#ffdddd3a",
"editor.selectionHighlightBackground": "#0088aa2a",
"editorWhitespace.foreground": "#ffffff2a",
"editorLineNumber.foreground": "#608070"
},
"editor.tokenColorCustomizations": {
"numbers": "#40c0c0",
"textMateRules": [
{
"name": "Default",
"scope": [
"source",
"variable.parameter",
"entity.other.inherited-class",
"constant.other", // all-caps "constant"
"meta.function-call"
],
"settings": {
"foreground": "#cccccc"
}
},
{
"name": "Keywords",
"scope": [
"keyword",
"keyword.operator.logical",
"storage.type.function", // `def` and `lambda`
"storage.type.class", // `class`
"storage.modifier.declaration" // `global`, `nonlocal`
],
"settings": {
"fontStyle": "",
"foreground": "#cccc60"
}
},
{
"name": "Operators",
"scope": "keyword.operator",
"settings": {
"foreground": "#dddddd"
}
},
{
"name": "Decorators",
"scope": "entity.name.function.decorator",
"settings": {
"fontStyle": "",
"foreground": "#bb6000"
}
},
{
"name": "Functions",
"scope": "entity.name.function",
"settings": {
"fontStyle": "bold"
}
},
{
"name": "Classes",
"scope": "entity.name.type",
"settings": {
"fontStyle": "bold",
"foreground": "#60d296"
}
},
{
"name": "Self",
"scope": "variable.language.special",
"settings": {
"foreground": "#aaaadd"
}
},
{
"name": "Built-in dunder methods",
"scope": "support.function.magic",
"settings": {
"fontStyle": "bold",
"foreground": "#8888dd"
}
},
{
"name": "Built-in functions",
"scope": "support.function",
"settings": {
"foreground": "#8888dd"
}
},
{
"name": "Type",
"scope": "support.type",
"settings": {
"foreground": "#60bb80"
}
},
{
"name": "Constant",
"scope": "constant.language",
"settings": {
"foreground": "#ccaa00"
}
},
{
"name": "Comments",
"scope": "comment",
"settings": {
"foreground": "#808080"
}
},
{
"name": "Formats",
"scope": "storage.type.format",
"settings": {
"fontStyle": "",
"foreground": "#66cc66"
}
}
]
},
// "python.pythonPath": "C:\\Users\\jyeung\\AppData\\Local\\Programs\\Python\\Launcher\\py",
"python.pythonPath": "py",
"launch": {
"version": "0.2.0",
"configurations": [
{
"name": "Python",
"type": "python",
"request": "launch",
"stopOnEntry": false,
"pythonPath": "${config:python.pythonPath}",
"program": "${relativeFile}",
"cwd": "",
"env": {},
"envFile": "${workspaceRoot}/.env",
"debugOptions": [
"WaitOnAbnormalExit",
"WaitOnNormalExit",
"RedirectOutput"
]
}
]
},
// "editor.matchBrackets": false,
// "subtleBrackets.styles": {
// "global": {
// "borderWidth": "1px",
// "borderStyle": "none none solid none"
// }
// },
// "bracketPairColorizer.consecutivePairColors": [
// "()",
// "[]",
// "{}",
// [
// "#cccccc"
// ],
// "Red"
// ],
"bracketPairColorizer.colorMode": "Independent",
"bracketPairColorizer.independentPairColors": [
[
"()",
[
"#cccccc"
],
"Red"
],
[
"[]",
[
"#cccccc"
],
"Red"
],
[
"{}",
[
"#cccccc"
],
"Red"
]
],
"editor.multiCursorModifier": "ctrlCmd"
} Screenshot to illustrate that I really don't have Python in output: Screenshot to show Python in terminal: |
Ok, here's the problem, the file you have opened is not part of the workspace, hence the settings for the workspace are not getting picked up. We'll have to introduce a change to get this feature working. |
@brettcannon @qubitron
Current behavior
Proposed behavior
I'm not sure why, but we currently have tests to avoid this particular situation (possibly a test to retain the behavior inherited from old code). |
To help manage our issues and to better communicate what the team plans to work on we are closing issues that we don't plan to work on but would accept a pull request from a volunteer for. To be clear, closing this issue does not mean we won't consider a pull request for this enhancement as outlined in our contributing guide, just that the development team has no plans to work on it themselves. |
✅ validated |
Environment data
Actual behavior
When I issue the command
Python: Run Python File in Terminal
, it always starts in the open folder, rather than in the file directory, despite the fact that I have"python.terminal.executeInFileDir": true
in my user settings.This has been a problem since forever; this setting has never worked for me on any previous version.
Expected behavior
The terminal starts in the file directory of the Python script I'm executing.
Steps to reproduce:
Python: Run Python File in Terminal
.Logs
Output for
Python
in theOutput
panel (View
→Output
, change the drop-down the upper-right of theOutput
panel toPython
)I don't understand those instructions. If I do
View
→Output
, there is noPython
in the drop-down. However, there is aPython
in the terminal. (If this is what you mean, then the template for the bug report should reflect that.)Suffice it to say that within the Python script,
os.getcwd()
is the open folder, when I am expecting it to be the same assys.path[0]
instead.Output from
Console
under theDeveloper Tools
panel (toggle Developer Tools on underHelp
)This is empty, unless I choose Verbose.
The text was updated successfully, but these errors were encountered: