summaryrefslogtreecommitdiff
path: root/doc/bugs/minor_display_glitch_with_ssh_password_prompting_and_-J.mdwn
blob: a8e0871a1497b3605d82849e8e5a37f05e237ece (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
When using -J and there's a ssh password prompt (or other prompt eg ssh
host key), the region-based display gets messed up by the ssh output. This
is a minor display glitch; it's still fairly clear what git-annex is doing.

The root problem is that the regional display code does not know the
absolute cursor position. All cursor movement is relative. So when ssh
display moves the cursor, all subsequent output goes to the wrong place.

ansi-terminal has absolute cursor movement, but no way to query position.

Some approaches to fix it:

1. Allocate a slave pty and run ssh in there, forwarding IO from the slave
   pty to the master pty. The ssh output is then added to the region that
   it's prompting for the password for.
   
   Unix-specific and somewhat heavyweight solution.

2. Set position to eg 0,0 when starting git-annex, and then the
   absolute position can be calculated, and after ssh runs it can reset the
   cursor to the previous position. 
   
   Would make -J take over the whole screen even if it's only transferring
   1 file.

3. Clear all regions before running the ssh command that can prompt,
   (moving the cursor to the start of the first region),
   and redraw them when it's done. So the ssh output would appear above the
   redrawn regions.

   This would cause some flicker in the common case where ssh does not have
   any output. The N regions would display briefly, then be cleared, then
   be redrawn. It might flicker multiple times, when multiple different
   hosts are being accessed. 
   
   One way to avoid the flicker would be to first
   try to ssh with password prompting disabled, and only if that fails do
   regions need to be cleared for the ssh that will prompt. Also, since
   we then know ssh will prompt, we can display the hostname as context for
   the "Password:" prompt it uses.

   Needs concurrent-output 1.8.0

4. Find a way to add cursor position querying to ansi-terminal. Can it be
   done portably?

   See <https://github.com/feuerbach/ansi-terminal/issues/7>

--[[Joey]]

> [[fixed|done]] using option #3. --[[Joey]]