//--------------------------------------------------------------------- // Overrides. //--------------------------------------------------------------------- protected override SshChannelBase CreateChannel(SshAuthenticatedSession session) { IEnumerable <EnvironmentVariable> environmentVariables = null; if (this.language != null) { // Format language so that Linux understands it. var languageFormatted = this.language.Name.Replace('-', '_'); environmentVariables = new[] { // // Try to pass locale - but do not fail the connection if // the server rejects it. // new EnvironmentVariable( "LC_ALL", $"{languageFormatted}.UTF-8", false) }; } return(session.OpenShellChannel( LIBSSH2_CHANNEL_EXTENDED_DATA.MERGE, this.terminal, this.terminalSize.Columns, this.terminalSize.Rows, environmentVariables)); }
//--------------------------------------------------------------------- // Overrides. //--------------------------------------------------------------------- protected override SshChannelBase CreateChannel(SshAuthenticatedSession session) { var currentLanguage = this.language.Name.Replace('-', '_'); return(session.OpenShellChannel( LIBSSH2_CHANNEL_EXTENDED_DATA.MERGE, this.terminal, this.terminalSize.Columns, this.terminalSize.Rows, new [] { // // Try to pass locale - but do not fail the connedction if // the server rejects it. // new SshAuthenticatedSession.EnvironmentVariable( "LC_ALL", $"{currentLanguage}.UTF-8", false) })); }
protected abstract SshChannelBase CreateChannel( SshAuthenticatedSession session);