Repository: nvaccess/nvda

Issue:
NVDA doesn't announce typed characters in putty
**Reported by aleksey_s on 2011-02-02 17:17**
It neither reads typed characters nor announces a deleted character when pressing backspace in putty's terminal window.



Discussion:
Comment 1 by jteh on 2011-02-02 20:56
Typed characters is an issue with PuTTY. It doesn't seem to fire WM_CHAR messages, probably because it doesn't call !TranslateMessage. I don't want to change our entire typed character mechanism just because of PuTTY and I don't really have any better ideas on how to handle this. Ideas are welcome.

Backspace is probably just because the server took too long to move the caret. On a faster link, this should be faster.

Comment 2 by mohammed on 2014-05-02 09:04
Hi. 

are there similar applications out there that do not have such a problem? what do blind server admins generally use?

btw, there must be a mechanism to make this work, because other screen readers echo typed characters fine. granted, you can't review text in such windows.

Comment 3 by msedmak (in reply to comment 2) on 2014-10-23 19:18
I have used terraterm (free) and have heard several others who use cygwin ssh (free) or SecureCRT (paid).
Replying to [mohammed](comment:2):

> Hi. 
> 
> are there similar applications out there that do not have such a problem? what do blind server admins generally use?
> 
> btw, there must be a mechanism to make this work, because other screen readers echo typed characters fine. granted, you can't review text in such windows.

Comfirmed. Since this is quite an old issue, giving this P4. @JCSTeh: Feel free to set another priority, since you are the initial author of this.
I noticed that this is also a problem in power shell. Given Power Shell is getting more and more a replacement for cmd, I wonder whether this priority should be raised. @michaeldcurran/@feerrenrut: thoughts about this?
@leonardder Possibly, though I don't think I would make it a P2.
Are you ok with a p3?
Yep, I'll apply that change now.
NVDA doesn't announce typed characters in putty Is this problem solved?
@aleksey_s, @Mohammed, could you please test if this is still an issue? Thanks!
Yes, this is still an issue.

MinTTY, a close relative console, also suffers from this issue: Typed characters are not echoed.
The `mintty` app module derives from the `putty` app module.
MinTTY is the default console of the Git Bash environment as shipped with Git for Windows.
Is this solved also for older Versions of Windows where UIA is not used?
> Is this solved also for older Versions of Windows where UIA is not used?

I don't know, but IMHO, this is not fully solved either for newer versions of Windows.
Demo: Open a new Git Bash Mintty terminal, run any command that produces output such as `ls`, wait for the output announcement to end or hit control to mute it, and then hit the backspace key a few times quickly.
Result: NVDA speaks text placed before the command prompt, depending on how many times backspace was pressed.
Expected: NVDA should not announce anything, as no character was deleted.
Ok Julien thank you for this report. I am reopening this issue and the discussion.
cc: @codeofdusk 

Resolving patch:
diff --git a/source/NVDAObjects/UIA/winConsoleUIA.py b/source/NVDAObjects/UIA/winConsoleUIA.py
--- a/source/NVDAObjects/UIA/winConsoleUIA.py
+++ b/source/NVDAObjects/UIA/winConsoleUIA.py
@@ -279,11 +279,6 @@ def _get_TextInfo(self):
 		bounds review to the visible text."""
 		return consoleUIATextInfo
 
-	def _get_caretMovementDetectionUsesEvents(self):
-		"""Using caret events in consoles sometimes causes the last character of the
-		prompt to be read when quickly deleting text."""
-		return False
-
 	def _getTextLines(self):
 		# Filter out extraneous empty lines from UIA
 		return (
diff --git a/source/NVDAObjects/behaviors.py b/source/NVDAObjects/behaviors.py
--- a/source/NVDAObjects/behaviors.py
+++ b/source/NVDAObjects/behaviors.py
@@ -367,6 +367,11 @@ def event_loseFocus(self):
 		super(Terminal, self).event_loseFocus()
 		self.stopMonitoring()
 
+	def _get_caretMovementDetectionUsesEvents(self):
+		"""Using caret events in consoles sometimes causes the last character of the
+		prompt to be read when quickly deleting text."""
+		return False
+
 
 class KeyboardHandlerBasedTypedCharSupport(Terminal):
 	"""A Terminal object that also provides typed character support for
diff --git a/source/NVDAObjects/window/winConsole.py b/source/NVDAObjects/window/winConsole.py
--- a/source/NVDAObjects/window/winConsole.py
+++ b/source/NVDAObjects/window/winConsole.py
@@ -79,11 +79,6 @@ def reconnect():
 				self.startMonitoring()
 		core.callLater(200,reconnect)
 
-	def _get_caretMovementDetectionUsesEvents(self):
-		"""Using caret events in consoles sometimes causes the last character of the
-		prompt to be read when quickly deleting text."""
-		return False
-
 	@script(gestures=[
 		"kb:enter",
 		"kb:numpadEnter",


Test patch: