File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -158,11 +158,20 @@ def main():
158
158
raw = sys .stdin .read ()
159
159
cleaned = clean_text (raw , preserve_invisible = args .invisible )
160
160
161
+ # Check if running inside VS Code extension host
162
+ vscode_extension = False
163
+ process_title = os .environ .get ('VSCODE_PROCESS_TITLE' , '' )
164
+ if process_title .startswith ('extension-host' ):
165
+ vscode_extension = True
166
+
161
167
# Handle newline at EOF based on -n/--no-newline
162
168
if not args .no_newline :
163
169
# Only add newline if there isn't one already
164
170
if not cleaned .endswith ('\n ' ):
165
171
cleaned += '\n '
172
+ # Add extra newline if running in VS Code extension host
173
+ if vscode_extension :
174
+ cleaned += '\n '
166
175
# If --no-newline is specified, leave the file exactly as is (no changes to newlines)
167
176
168
177
sys .stdout .write (cleaned )
You can’t perform that action at this time.
0 commit comments