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
860
 
860
 
861
             ! Push with upstream configuration to origin
861
             ! Push with upstream configuration to origin
862
             print '(A)', 'No upstream configured. Pushing to origin/' // trim(current_branch) // '...'
862
             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), '"'
864
             call execute_command_line(trim(command), exitstat=status)
864
             call execute_command_line(trim(command), exitstat=status)
865
 
865
 
866
             if (status == 0) then
866
             if (status == 0) then
@@ -874,7 +874,7 @@ contains
874
         else
874
         else
875
             ! Upstream exists - do regular push
875
             ! Upstream exists - do regular push
876
             print '(A)', 'Pushing to upstream...'
876
             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)
878
 
878
 
879
             if (status == 0) then
879
             if (status == 0) then
880
                 print '(A)', achar(27) // '[32m✓ Pushed successfully!' // achar(27) // '[0m'
880
                 print '(A)', achar(27) // '[32m✓ Pushed successfully!' // achar(27) // '[0m'
@@ -1910,7 +1910,7 @@ contains
1910
 
1910
 
1911
         ! Push specific tag to origin
1911
         ! Push specific tag to origin
1912
         print '(A)', 'Pushing tag to origin...'
1912
         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), '"'
1914
         call execute_command_line(trim(command), exitstat=status)
1914
         call execute_command_line(trim(command), exitstat=status)
1915
 
1915
 
1916
         if (status == 0) then
1916
         if (status == 0) then
src/terminal_module.f90modified
@@ -38,9 +38,9 @@ contains
38
 
38
 
39
     subroutine flush_stdin()
39
     subroutine flush_stdin()
40
         integer :: status
40
         integer :: status
41
-        ! Flush any buffered input from stdin using dd with non-blocking I/O
41
+        ! Flush any buffered input from stdin
42
-        ! This prevents queued keypresses from being processed after long operations
42
+        ! Use a simple bash read with very short timeout to drain buffer without blocking
43
-        call execute_command_line('dd if=/dev/tty of=/dev/null iflag=nonblock count=1 status=none 2>/dev/null', &
43
+        call execute_command_line('while read -t 0.001 -n 1 < /dev/tty 2>/dev/null; do :; done', &
44
                                   exitstat=status)
44
                                   exitstat=status)
45
     end subroutine flush_stdin
45
     end subroutine flush_stdin
46
 
46