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():
158158 raw = sys .stdin .read ()
159159 cleaned = clean_text (raw , preserve_invisible = args .invisible )
160160
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+
161167 # Handle newline at EOF based on -n/--no-newline
162168 if not args .no_newline :
163169 # Only add newline if there isn't one already
164170 if not cleaned .endswith ('\n ' ):
165171 cleaned += '\n '
172+ # Add extra newline if running in VS Code extension host
173+ if vscode_extension :
174+ cleaned += '\n '
166175 # If --no-newline is specified, leave the file exactly as is (no changes to newlines)
167176
168177 sys .stdout .write (cleaned )
You can’t perform that action at this time.
0 commit comments