[01] SSH Server Technical Support

These discussion groups are closed due to spam that could not be controlled within abilities of this support system.

For any technical or licensing inquiries about Bitvise SSH Server, please open a new support case.

Any information you find herein is outdated, and not applicable to our latest software versions.

WinSSHD, powershell, and dumb terminals

My question - using powershell with a "dumb" *nix terminal emulator - has been asked several times on this forum, but I came across a workaround for a similar problem on Windows fora, so am asking the question again.

Here are two relevant WinSSHD forum exchanges (same problem I'm having)...

From 2009:

a) https://fogbugz.bitvise.com/default.asp?WinSSHD.1.13393.4

powershell malfunctions if stdin is redirected.

from 2010:

b) https://fogbugz.bitvise.com/default.asp?WinSSHD.1.13956.1

In this exchange it's said that "Powershell simply doesn't work well with redirected I/O. I can't see any reasons why it couldn't work this way..."

I poked around a bit and found this post at stackoverflow:

c) http://stackoverflow.com/questions/4238192/running-powershell-from-msdeploy-runcommand-does-not-exit/4239192#4239192

and this post at Microsoft connect:

d) https://connect.microsoft.com/PowerShell/feedback/details/572313/powershell-exe-can-hang-if-stdin-is-redirected

(I can't tell from the July 2010 workaround at the MS site whether or not "-noninteractive" behaves the same as the undocumented "-inputformat none")

In addition, there's a Feb 2012 Microsoft response that updates a 2007 request for additional functionality in powershell. It may not be relevant:

(e) https://connect.microsoft.com/feedback/ViewFeedback.aspx?FeedbackID=297055&SiteID=99

---> Back to the question: powershell and "dumb" terminals:

Are any of posts (c) through (e) relevant?

Posts (c) and (d) look very much like the "dumb terminal" hang encountered when the Windows login shell is powershell.

I altered my login shell entry on the Windows box to be:

C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -inputformat none

but when I connected, powershell once again hung.

Powershell seems to run fine locally with both -inputformat none and -noninteractive.

If posts (c) thru (e) are relevant, do they suggest a work-around?


Much obliged for any suggestions...

Jim Snyder


Environment details:

I am connecting with

OpenSSH_5.5p1, OpenSSL 1.0.0e-fips 6 Sep 2011

from a Fedora 14 linux system.

Console output in the linux window (a gnome-term) is:

$ TERM="" ssh <Windows machine>
Enter passphrase for key '/home/jhs/.ssh/id_rsa':
Windows PowerShell
                  Copyright (C) 2009 Microsoft Corporation. All rights reserved.


The Windows OS is Windows Home Premium, SP1, with all updates installed.

Powershell is v2.

The WinSSHD version is 5.26
Jim Snyder
Sunday, April 22, 2012
OK, solved for me per this link:


(about mid-way down the page, see the note under the heading "Invoke a powerShell Command ...)

When PowerShell detects that its input or output streams have been redirected, it suppresses any prompts that it might normally display. If you are want to host an interactive PowerShell prompt inside another application (such as Emacs), use "-" as the argument for the -File parameter. In many shells, this implies "taken from standard input."

powershell -File -

When I set the WinSSHD login shell command line to use this hack, I can log in from my dumb terminal window, and everything works.

The one fly in the ointment is that the terminal window acts half-duplex: I don't get to see the line I'm typing - not while I'm typing, not after I type the newline ... I get the output of the command, so powershell is getting the command and executing it and sending back the results, but it is not echo'ing the characters I typed in the terminal window.

This works for me because my "dumb" terminal (9term) has a menu option that toggles between "cooked" and "uncooked" modes (as in stty cooked).

The 9term man page here:


discusses what's going on; see the para that starts "9term changes behavior according to the terminal settings..."

There seem to be many parameters one can play with, scattered across a wide range of applications.

This hack accomplishes what I wanted to accomplish.
Jim Snyder
Sunday, April 22, 2012
Hello Jim,

thanks for posting that. I'll add this insight to the WinSSHD Usage FAQ.
denis bider
Tuesday, April 24, 2012

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics
Powered by FogBugz