fortrangoingonforty/fuss / dce2ec9

Browse files

actually fix hangs

Authored by espadonne
SHA
dce2ec9cb8de598a0fa4e042bc56d0689d04d66f
Parents
cc5c451
Tree
f9d4287

2 changed files

StatusFile+-
M src/git_module.f90 3 3
M src/terminal_module.f90 3 3
src/git_module.f90modified
@@ -860,7 +860,7 @@ contains
860860
 
861861
             ! Push with upstream configuration to origin
862862
             print '(A)', 'No upstream configured. Pushing to origin/' // trim(current_branch) // '...'
863
-            write(command, '(A,A,A)') 'git push -u origin "', trim(current_branch), '" 2>&1'
863
+            write(command, '(A,A,A)') 'git push -u origin "', trim(current_branch), '"'
864864
             call execute_command_line(trim(command), exitstat=status)
865865
 
866866
             if (status == 0) then
@@ -874,7 +874,7 @@ contains
874874
         else
875875
             ! Upstream exists - do regular push
876876
             print '(A)', 'Pushing to upstream...'
877
-            call execute_command_line('git push 2>&1', exitstat=status)
877
+            call execute_command_line('git push', exitstat=status)
878878
 
879879
             if (status == 0) then
880880
                 print '(A)', achar(27) // '[32m✓ Pushed successfully!' // achar(27) // '[0m'
@@ -1910,7 +1910,7 @@ contains
19101910
 
19111911
         ! Push specific tag to origin
19121912
         print '(A)', 'Pushing tag to origin...'
1913
-        write(command, '(A,A,A)') 'git push origin "', trim(tag_name), '" 2>&1'
1913
+        write(command, '(A,A,A)') 'git push origin "', trim(tag_name), '"'
19141914
         call execute_command_line(trim(command), exitstat=status)
19151915
 
19161916
         if (status == 0) then
src/terminal_module.f90modified
@@ -38,9 +38,9 @@ contains
3838
 
3939
     subroutine flush_stdin()
4040
         integer :: status
41
-        ! Flush any buffered input from stdin using dd with non-blocking I/O
42
-        ! This prevents queued keypresses from being processed after long operations
43
-        call execute_command_line('dd if=/dev/tty of=/dev/null iflag=nonblock count=1 status=none 2>/dev/null', &
41
+        ! Flush any buffered input from stdin
42
+        ! Use a simple bash read with very short timeout to drain buffer without blocking
43
+        call execute_command_line('while read -t 0.001 -n 1 < /dev/tty 2>/dev/null; do :; done', &
4444
                                   exitstat=status)
4545
     end subroutine flush_stdin
4646