@@ -374,12 +374,12 @@ def _query_background_color() -> BackgroundType:
374374 # Read character by character with timeout to avoid blocking
375375 import fcntl
376376 import os
377-
377+
378378 # Set stdin to non-blocking mode
379379 fd = sys .stdin .fileno ()
380380 fl = fcntl .fcntl (fd , fcntl .F_GETFL )
381381 fcntl .fcntl (fd , fcntl .F_SETFL , fl | os .O_NONBLOCK )
382-
382+
383383 # Read up to 50 chars with timeout
384384 for _ in range (50 ):
385385 ready = select .select ([sys .stdin ], [], [], 0.01 )[0 ]
@@ -390,12 +390,12 @@ def _query_background_color() -> BackgroundType:
390390 break
391391 response += char
392392 # Stop if we get the expected terminator
393- if response .endswith (' \033 \\ ' ):
393+ if response .endswith (" \033 \\ " ):
394394 break
395-
395+
396396 # Restore blocking mode
397397 fcntl .fcntl (fd , fcntl .F_SETFL , fl )
398-
398+
399399 except (OSError , ImportError ):
400400 # Fallback to simple read if fcntl is not available
401401 response = sys .stdin .read (50 )
@@ -416,7 +416,9 @@ def _query_background_color() -> BackgroundType:
416416 blue : int = int (b [:2 ], 16 ) if len (b ) >= 2 else 0
417417
418418 # Calculate perceived brightness using standard formula
419- brightness : float = (red * 299 + green * 587 + blue * 114 ) / 1000
419+ brightness : float = (
420+ red * 299 + green * 587 + blue * 114
421+ ) / 1000
420422
421423 # Restore terminal settings
422424 termios .tcsetattr (sys .stdin , termios .TCSADRAIN , old_settings )
0 commit comments