Skip to content

Commit

Permalink
Azure: follow the user's shell choice from the online portal
Browse files Browse the repository at this point in the history
Fixes #2266.
  • Loading branch information
DHowett committed Feb 29, 2020
1 parent e10dec7 commit 0dd8745
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions src/cascadia/TerminalConnection/AzureConnection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -693,11 +693,7 @@ namespace winrt::Microsoft::Terminal::TerminalConnection::implementation
_WriteStringWithNewline(RS_(L"AzureSuccess"));

// Request for a terminal for said cloud shell
// We only support bash for now, so don't bother with the user's preferred shell
// fyi: we can't call powershell yet because it sends VT sequences we don't support yet
// TODO: GitHub #1883
//const auto shellType = settingsResponse.at(L"properties").at(L"preferredShellType").as_string();
const auto shellType = L"bash";
const auto shellType = settingsResponse.at(L"properties").at(L"preferredShellType").as_string();
_WriteStringWithNewline(RS_(L"AzureRequestingTerminal"));
const auto socketUri = _GetTerminal(shellType);
_TerminalOutputHandlers(L"\r\n");
Expand Down Expand Up @@ -880,9 +876,8 @@ namespace winrt::Microsoft::Terminal::TerminalConnection::implementation
http_request shellRequest(L"PUT");
shellRequest.set_request_uri(L"providers/Microsoft.Portal/consoles/default?api-version=2018-10-01");
_HeaderHelper(shellRequest);
const auto innerBody = json::value::parse(U("{ \"osType\" : \"linux\" }"));
json::value body;
body[U("properties")] = innerBody;
// { "properties": { "osType": "linux" } }
auto body = json::value::object({ { U("properties"), json::value::object({ { U("osType"), json::value::string(U("linux")) } }) } });
shellRequest.set_body(body);

// Send the request and get the response as a json value
Expand Down

0 comments on commit 0dd8745

Please sign in to comment.