Code

git-gui: Use progress bar while resetting/aborting files
[git.git] / lib / console.tcl
index 27a880e408fbdcf1f9caf66adf92f42403538341..6f718fbac3277daed7d0d4e10c76241490c4c216 100644 (file)
@@ -47,16 +47,20 @@ method _init {} {
                -background white -borderwidth 1 \
                -relief sunken \
                -width 80 -height 10 \
+               -wrap none \
                -font font_diff \
                -state disabled \
+               -xscrollcommand [list $w.m.sbx set] \
                -yscrollcommand [list $w.m.sby set]
        label $w.m.s -text {Working... please wait...} \
                -anchor w \
                -justify left \
                -font font_uibold
+       scrollbar $w.m.sbx -command [list $w.m.t xview] -orient h
        scrollbar $w.m.sby -command [list $w.m.t yview]
        pack $w.m.l1 -side top -fill x
        pack $w.m.s -side bottom -fill x
+       pack $w.m.sbx -side bottom -fill x
        pack $w.m.sby -side right -fill y
        pack $w.m.t -side left -fill both -expand 1
        pack $w.m -side top -fill both -expand 1 -padx 5 -pady 10
@@ -87,19 +91,12 @@ method _init {} {
 }
 
 method exec {cmd {after {}}} {
-       # -- Cygwin's Tcl tosses the enviroment when we exec our child.
-       #    But most users need that so we have to relogin. :-(
-       #
-       if {[is_Cygwin]} {
-               set cmd [list sh --login -c "cd \"[pwd]\" && [join $cmd { }]"]
+       if {[lindex $cmd 0] eq {git}} {
+               set fd_f [eval git_read --stderr [lrange $cmd 1 end]]
+       } else {
+               lappend cmd 2>@1
+               set fd_f [_open_stdout_stderr $cmd]
        }
-
-       # -- Tcl won't let us redirect both stdout and stderr to
-       #    the same pipe.  So pass it through cat...
-       #
-       set cmd [concat | $cmd |& cat]
-
-       set fd_f [open $cmd r]
        fconfigure $fd_f -blocking 0 -translation binary
        fileevent $fd_f readable [cb _read $fd_f $after]
 }