Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Introduce integrated terminal #3079

Merged
merged 70 commits into from
Jan 9, 2025
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
70 commits
Select commit Hold shift + click to select a range
0f14050
chore: remove code duplication in preparation to handling integrated …
zFernand0 Aug 27, 2024
73f5814
chore: done consolidating, fixing unit test before continuing :yum:
zFernand0 Aug 28, 2024
ee95d66
tests: fix unit tests and address any missing checks :yum:
zFernand0 Aug 28, 2024
48abeef
tests: fix the rest of the unit tests :yum:
zFernand0 Aug 29, 2024
43d6863
l10n: update strings :yum:
zFernand0 Aug 29, 2024
beba0c4
chore: Add zoweTerminal :yum:
zFernand0 Aug 29, 2024
d3b5975
chore: finalize ZoweTerminal implementation :yum:
zFernand0 Aug 30, 2024
4f7dd21
chore: add actual z/os behavior :yum:
zFernand0 Aug 30, 2024
451c49b
chore: add missing license header
zFernand0 Oct 9, 2024
978ff99
tests: fix unit tests assuming we are not using integrated terminals
zFernand0 Oct 9, 2024
8b2d310
feat: initial addition of zowe commands to edit History webview
zFernand0 Oct 9, 2024
ee12695
fix: done with core terminal issues
zFernand0 Oct 9, 2024
859807c
tests: fix unit tests for now :yum:
zFernand0 Oct 10, 2024
6d49d02
fix remainig unit tests
zFernand0 Oct 21, 2024
65c8e24
Merge branch 'main' of https://github.com/zowe/zowe-explorer-vscode i…
zFernand0 Oct 21, 2024
04927a3
fix: remove circular references
zFernand0 Oct 21, 2024
96a8d25
test: add small unit test :yum:
zFernand0 Oct 21, 2024
257254b
test: add more unit testws to bump patch coverage
zFernand0 Oct 22, 2024
819e742
chore: more unit tests
zFernand0 Oct 22, 2024
3898c54
Merge branch 'main' into feat/int-term
zFernand0 Oct 22, 2024
ef41fcf
fix: edge case when processing double-byte characters
zFernand0 Oct 23, 2024
93b6c30
fix handle unicode characters
zFernand0 Oct 23, 2024
52eb208
fix: error handling for failing responses from the server
zFernand0 Oct 23, 2024
062327f
Merge branch 'main' into feat/int-term
zFernand0 Oct 29, 2024
20c313a
Update packages/zowe-explorer/src/commands/UnixCommandHandler.ts
zFernand0 Oct 29, 2024
7f1375e
test: update test to reflect less operation cancelled notifications :…
zFernand0 Oct 29, 2024
54c2f89
review: updates based on feedback :yum:
zFernand0 Oct 29, 2024
612473d
Merge branch 'main' of https://github.com/zowe/zowe-explorer-vscode i…
zFernand0 Oct 30, 2024
6df816c
review: localize strings in package.json
zFernand0 Oct 30, 2024
b6170fa
Merge branch 'main' into feat/int-term
JillieBeanSim Oct 31, 2024
75d1386
fix: profile selection cached between commands via the palette
zFernand0 Oct 31, 2024
882db9a
fix: iTerm setting not working from the workspace scope :yum:
zFernand0 Oct 31, 2024
1ba492a
Merge branch 'main' of https://github.com/zowe/zowe-explorer-vscode i…
zFernand0 Oct 31, 2024
7833f74
fix: make profile validation consistent amonogst all cmdTypes
zFernand0 Oct 31, 2024
88e064b
review: add validation of SSH porfiles:
zFernand0 Oct 31, 2024
33294c9
chore: multiple fixes (see below)
zFernand0 Nov 1, 2024
986fbaf
feat: separated commands history :yum:
zFernand0 Nov 1, 2024
e181481
fix: Greyout entry text in iTerms
zFernand0 Nov 1, 2024
e618b14
review: fix unit test after adding validation
zFernand0 Nov 2, 2024
75a6d03
chore: update changelog
zFernand0 Nov 2, 2024
7f18310
review: updated sdk and removed ssh2 lazy-loading
zFernand0 Nov 6, 2024
85696d1
chore: update unit tests for new APIs
zFernand0 Nov 6, 2024
931ed3f
chore: update dependencies across the board
zFernand0 Nov 6, 2024
3311857
Merge branch 'main' of https://github.com/zowe/zowe-explorer-vscode i…
zFernand0 Nov 6, 2024
133276e
Merge branch 'main' of https://github.com/zowe/zowe-explorer-vscode i…
zFernand0 Nov 6, 2024
ccc9f48
chore: fix lint issues and update changelogs
zFernand0 Nov 6, 2024
a18f7f6
review: fis unit tests
zFernand0 Nov 6, 2024
230e933
chore: cleanup ssh profile validation logic
zFernand0 Nov 6, 2024
172cfe5
review: update changelog
zFernand0 Nov 12, 2024
f578724
review: add italic to :clear command
zFernand0 Nov 25, 2024
dc3d748
Merge branch 'main' of https://github.com/zowe/zowe-explorer-vscode i…
zFernand0 Nov 25, 2024
50fd881
review: address lint issues
zFernand0 Nov 25, 2024
f5546a6
review: Address delete key, and cancel operations
zFernand0 Dec 10, 2024
5e5242f
review: revert typecript update
zFernand0 Dec 10, 2024
725e369
review: remove redundant logs
zFernand0 Dec 10, 2024
f839d0e
Merge branch 'main' of https://github.com/zowe/zowe-explorer-vscode i…
zFernand0 Dec 10, 2024
09e0ce2
review: fix delete key with moving cursor across emojis and special c…
zFernand0 Dec 10, 2024
b707bdb
Merge branch 'main' of https://github.com/zowe/zowe-explorer-vscode i…
zFernand0 Dec 10, 2024
05a892c
review: fix oversight of moving to charArray
zFernand0 Dec 10, 2024
2716e21
review: handle home and end keys
zFernand0 Dec 10, 2024
a9247fc
review: address home and end key
zFernand0 Dec 10, 2024
d58c416
review: display non printable characters
zFernand0 Dec 10, 2024
f4d60dd
Merge branch 'main' into feat/int-term
zFernand0 Dec 17, 2024
4d498c4
review: fix modifier keys and add intuitive control+C exit
zFernand0 Dec 18, 2024
c998f8d
review: bump test coverage of the zowe terminal
zFernand0 Dec 19, 2024
9f18ec5
review: avoid deprecating tsoCommand function and more
zFernand0 Jan 7, 2025
f9329b1
Merge branch 'main' of https://github.com/zowe/zowe-explorer-vscode i…
zFernand0 Jan 7, 2025
19c45bc
review: address final review comments
zFernand0 Jan 8, 2025
36ec243
Merge branch 'main' into feat/int-term
zFernand0 Jan 8, 2025
ee113df
review: address Trae's suggestions :yum:
zFernand0 Jan 8, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -675,12 +675,6 @@ describe("ZosmfCommandApi", () => {
args: ["command", { account: "ACCT#" }],
transform: (args) => [args[1].account, ...args],
},
{
name: "issueTsoCmdWithParms",
spy: jest.spyOn(zostso.IssueTso, "issueTsoCmd"),
args: ["command"],
transform: (args) => [...args, { addressSpaceOptions: undefined }],
},
{
name: "issueMvsCommand",
spy: jest.spyOn(zosconsole.IssueCommand, "issue"),
Expand Down
13 changes: 1 addition & 12 deletions packages/zowe-explorer-api/src/extend/MainframeInteraction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -505,19 +505,8 @@ export namespace MainframeInteraction {
* @param {zostso.IStartTsoParms} parms
* @returns {Promise<zostso.IIssueResponse>}
* @memberof ICommand
* @deprecated Please use `issueTsoCmdWithParms`
*/
issueTsoCommandWithParms?(command: string, parms?: zostso.IStartTsoParms): Promise<zostso.IIssueResponse>;

/**
* Issues a TSO Command without the need for account information
*
* @param {string} command
* @param {zostso.IStartTsoParms} parms
* @returns {Promise<zostso.IIssueResponse>}
* @memberof ICommand
*/
issueTsoCmdWithParms?(command: string, parms?: zostso.IStartTsoParms): Promise<zostso.IIssueResponse>;
issueTsoCommandWithParms?(command: string, parms?: zostso.IStartTsoParms, useNewTsoApis?: boolean): Promise<zostso.IIssueResponse>;

/**
* Issues a MVS Command and returns a Console Command API response.
Expand Down
10 changes: 5 additions & 5 deletions packages/zowe-explorer-api/src/profiles/ZoweExplorerZosmfApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -452,15 +452,15 @@
* An implementation of the Zowe Explorer Command API interface for zOSMF.
*/
export class CommandApi extends CommonApi implements MainframeInteraction.ICommand {
public issueTsoCommandWithParms(command: string, parms: zostso.IStartTsoParms): Promise<zostso.IIssueResponse> {
public issueTsoCommandWithParms(command: string, parms: zostso.IStartTsoParms, useNewTsoApis?: boolean): Promise<zostso.IIssueResponse> {
if (useNewTsoApis) {
return zostso.IssueTso.issueTsoCmd(this.getSession(), command, { addressSpaceOptions: parms });

Check warning on line 457 in packages/zowe-explorer-api/src/profiles/ZoweExplorerZosmfApi.ts

View check run for this annotation

Codecov / codecov/patch

packages/zowe-explorer-api/src/profiles/ZoweExplorerZosmfApi.ts#L457

Added line #L457 was not covered by tests
zFernand0 marked this conversation as resolved.
Show resolved Hide resolved
}

// eslint-disable-next-line deprecation/deprecation
return zostso.IssueTso.issueTsoCommand(this.getSession(), parms.account, command, parms);
}

public issueTsoCmdWithParms(command: string, parms: zostso.IStartTsoParms): Promise<zostso.IIssueResponse> {
return zostso.IssueTso.issueTsoCmd(this.getSession(), command, { addressSpaceOptions: parms });
}

public issueMvsCommand(command: string, consoleName?: string): Promise<zosconsole.IConsoleResponse> {
return zosconsole.IssueCommand.issue(this.getSession(), { command, consoleName, processResponses: true });
}
Expand All @@ -478,11 +478,11 @@
true
);
} else {
await zosuss.Shell.executeSsh(

Check warning on line 481 in packages/zowe-explorer-api/src/profiles/ZoweExplorerZosmfApi.ts

View check run for this annotation

Codecov / codecov/patch

packages/zowe-explorer-api/src/profiles/ZoweExplorerZosmfApi.ts#L481

Added line #L481 was not covered by tests
sshSession,
command,
(data: string) => {
stdout += data;

Check warning on line 485 in packages/zowe-explorer-api/src/profiles/ZoweExplorerZosmfApi.ts

View check run for this annotation

Codecov / codecov/patch

packages/zowe-explorer-api/src/profiles/ZoweExplorerZosmfApi.ts#L484-L485

Added lines #L484 - L485 were not covered by tests
},
true
);
Expand Down
4 changes: 3 additions & 1 deletion packages/zowe-explorer-api/src/tree/ZoweTreeNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import * as vscode from "vscode";
import * as imperative from "@zowe/imperative";
import { IZoweTreeNode } from "./IZoweTreeNode";
import type { BaseProvider } from "../fs/BaseProvider";

/**
* Common implementation of functions and methods associated with the
Expand Down Expand Up @@ -98,8 +99,9 @@ export class ZoweTreeNode extends vscode.TreeItem {
* Sets the imperative.IProfileLoaded profile for this node to the one chosen in parameters.
*
* @param {imperative.IProfileLoaded} aProfile The profile you will set the node to use
* @param {BaseProfider} _fsProvider An unused FS Provider
*/
public setProfileToChoice(aProfile: imperative.IProfileLoaded): void {
public setProfileToChoice(aProfile: imperative.IProfileLoaded, _fsProvider?: BaseProvider): void {
// Don't reassign profile if its already defined, as we want to keep the reference valid for other nodes and filesystems
this.profile = Object.assign(this.profile ?? {}, aProfile);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ describe("UnixCommand Actions Unit Testing", () => {
checkCurrentProfile: jest.fn(() => {
return profilesForValidation;
}),
profileValidationHelper: jest.fn().mockReturnValue("active"), //.mockImplementation((prof, fun) => fun(prof)),
profileValidationHelper: jest.fn().mockReturnValue("active"),
validateProfiles: jest.fn(),
getBaseProfile: jest.fn(),
validProfile: Validation.ValidationType.VALID,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import { Profiles } from "../../../src/configuration/Profiles";
import { ZoweDatasetNode } from "../../../src/trees/dataset/ZoweDatasetNode";
import { SharedContext } from "../../../src/trees/shared/SharedContext";
import { createIJobFile } from "../../__mocks__/mockCreators/jobs";
import { AuthUtils } from "../../../src/utils/AuthUtils";
import { ZoweLogger } from "../../../src/tools/ZoweLogger";
import { SettingsConfig } from "../../../src/configuration/SettingsConfig";
Fixed Show fixed Hide fixed
import { Constants } from "../../../src/configuration/Constants";
Expand Down
3 changes: 1 addition & 2 deletions packages/zowe-explorer/l10n/bundle.l10n.json
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,6 @@
"Certificate Key for Authentication.": "Certificate Key for Authentication.",
"Certificate Keys": "Certificate Keys",
"Select Certificate Key": "Select Certificate Key",
"Update Credentials": "Update Credentials",
"Required parameter 'host' must not be blank.": "Required parameter 'host' must not be blank.",
"Your connection is no longer active for profile '{0}'. Please log in to an authentication service to restore the connection./Profile name": {
"message": "Your connection is no longer active for profile '{0}'. Please log in to an authentication service to restore the connection.",
Expand Down Expand Up @@ -684,7 +683,6 @@
"Save as User setting": "Save as User setting",
"Save as Workspace setting": "Save as Workspace setting",
"Failed to list datasets": "Failed to list datasets",
"Failed to list dataset members": "Failed to list dataset members",
"Failed to read {0}/File path": {
"message": "Failed to read {0}",
"comment": [
Expand Down Expand Up @@ -920,6 +918,7 @@
},
"Add Credentials": "Add Credentials",
"Add username and password for basic authentication": "Add username and password for basic authentication",
"Update Credentials": "Update Credentials",
"Update stored username and password": "Update stored username and password",
"Disable Profile Validation": "Disable Profile Validation",
"Disable validation of server check for profile": "Disable validation of server check for profile",
Expand Down
5 changes: 2 additions & 3 deletions packages/zowe-explorer/l10n/poeditor.json
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@
"Toggle if Unix Commands persist locally": ""
},
"zowe.commands.alwaysEdit": {
"Allow editing of commands before submitting": ""
"Allow commands to eb edited before submitting": ""
zFernand0 marked this conversation as resolved.
Show resolved Hide resolved
},
"zowe.commands.useIntegratedTerminals": {
"Allow commands to be executed using integrated terminals": ""
Expand Down Expand Up @@ -535,7 +535,6 @@
"Certificate Key for Authentication.": "",
"Certificate Keys": "",
"Select Certificate Key": "",
"Update Credentials": "",
"Required parameter 'host' must not be blank.": "",
"Your connection is no longer active for profile '{0}'. Please log in to an authentication service to restore the connection.": "",
"Use the search button to list USS files": "",
Expand Down Expand Up @@ -744,7 +743,6 @@
"Save as User setting": "",
"Save as Workspace setting": "",
"Failed to list datasets": "",
"Failed to list dataset members": "",
"Failed to read {0}": "",
"Saving data set...": "",
"Failed to save {0}": "",
Expand Down Expand Up @@ -831,6 +829,7 @@
"Insufficient write permissions for {0} in local storage.": "",
"Add Credentials": "",
"Add username and password for basic authentication": "",
"Update Credentials": "",
"Update stored username and password": "",
"Disable Profile Validation": "",
"Disable validation of server check for profile": "",
Expand Down
2 changes: 1 addition & 1 deletion packages/zowe-explorer/package.nls.json
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@
"zowe.commands.mvs.history": "Toggle if MVS Commands persist locally",
"zowe.commands.tso.history": "Toggle if TSO Commands persist locally",
"zowe.commands.uss.history": "Toggle if Unix Commands persist locally",
"zowe.commands.alwaysEdit": "Allow editing of commands before submitting",
"zowe.commands.alwaysEdit": "Allow commands to eb edited before submitting",
zFernand0 marked this conversation as resolved.
Show resolved Hide resolved
"zowe.commands.useIntegratedTerminals": "Allow commands to be executed using integrated terminals",
"zowe.automaticProfileValidation": "Allow automatic validation of profiles.",
"zowe.pollInterval.info": "Default interval (in milliseconds) when polling spool files.",
Expand Down
1 change: 0 additions & 1 deletion packages/zowe-explorer/src/commands/MvsCommandHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,13 @@
return this.instance;
}

public readonly controller: AbortController = new AbortController();
public readonly dialogs: ICommandProviderDialogs = {
commandSubmitted: vscode.l10n.t("MVS command submitted."),
defaultText: `$(plus) ${vscode.l10n.t("Create a new MVS command")}`,
selectProfile: vscode.l10n.t("Select the profile to use to submit the MVS command"),
searchCommand: vscode.l10n.t("Enter or update the MVS command"),
writeCommand: (options) =>
vscode.l10n.t({

Check warning on line 49 in packages/zowe-explorer/src/commands/MvsCommandHandler.ts

View check run for this annotation

Codecov / codecov/patch

packages/zowe-explorer/src/commands/MvsCommandHandler.ts#L48-L49

Added lines #L48 - L49 were not covered by tests
message: "Select an MVS command to run against {0} (An option to edit will follow)",
args: options,
comment: ["Host name"],
Expand Down Expand Up @@ -104,9 +103,9 @@
}
await this.issueCommand(profile, command ?? "");
}
} else {
Gui.errorMessage(vscode.l10n.t("Profile is invalid"));
return;

Check warning on line 108 in packages/zowe-explorer/src/commands/MvsCommandHandler.ts

View check run for this annotation

Codecov / codecov/patch

packages/zowe-explorer/src/commands/MvsCommandHandler.ts#L106-L108

Added lines #L106 - L108 were not covered by tests
}
} catch (error) {
if (error.toString().includes("non-existing")) {
Expand Down
1 change: 0 additions & 1 deletion packages/zowe-explorer/src/commands/TsoCommandHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,13 @@
public history: ZowePersistentFilters;
private static instance: TsoCommandHandler;

public readonly controller: AbortController = new AbortController();
public readonly dialogs: ICommandProviderDialogs = {
commandSubmitted: vscode.l10n.t("TSO command submitted."),
defaultText: `$(plus) ${vscode.l10n.t("Create a new TSO command")}`,
selectProfile: vscode.l10n.t("Select the profile to use to submit the TSO command"),
searchCommand: vscode.l10n.t("Enter or update the TSO command"),
writeCommand: (options) =>
vscode.l10n.t({

Check warning on line 53 in packages/zowe-explorer/src/commands/TsoCommandHandler.ts

View check run for this annotation

Codecov / codecov/patch

packages/zowe-explorer/src/commands/TsoCommandHandler.ts#L52-L53

Added lines #L52 - L53 were not covered by tests
message: "Select a TSO command to run against {0} (An option to edit will follow)",
args: options,
comment: ["Host name"],
Expand Down Expand Up @@ -113,9 +112,9 @@
}
await this.issueCommand(profile, command ?? "");
}
} else {
Gui.errorMessage(vscode.l10n.t("Profile is invalid"));
return;

Check warning on line 117 in packages/zowe-explorer/src/commands/TsoCommandHandler.ts

View check run for this annotation

Codecov / codecov/patch

packages/zowe-explorer/src/commands/TsoCommandHandler.ts#L115-L117

Added lines #L115 - L117 were not covered by tests
}
} catch (error) {
if (error.toString().includes("non-existing")) {
Expand Down Expand Up @@ -155,7 +154,7 @@
*/
private async getTsoParams(): Promise<zostso.IStartTsoParms> {
ZoweLogger.trace("TsoCommandHandler.getTsoParams called.");
const profileInfo = await this.profileInstance.getProfileInfo();

Check warning on line 157 in packages/zowe-explorer/src/commands/TsoCommandHandler.ts

View check run for this annotation

Codecov / codecov/patch

packages/zowe-explorer/src/commands/TsoCommandHandler.ts#L157

Added line #L157 was not covered by tests
let tsoParms: zostso.IStartTsoParms = {};

// Keys in the IStartTsoParms interface
Expand All @@ -164,7 +163,7 @@
const profiles = profileInfo.getAllProfiles("tso");
let tsoProfile: imperative.IProfileLoaded;
if (profiles.length > 0) {
tsoProfile = await this.selectServiceProfile(profiles.map((p) => imperative.ProfileInfo.profAttrsToProfLoaded(p)));

Check warning on line 166 in packages/zowe-explorer/src/commands/TsoCommandHandler.ts

View check run for this annotation

Codecov / codecov/patch

packages/zowe-explorer/src/commands/TsoCommandHandler.ts#L166

Added line #L166 was not covered by tests
if (tsoProfile != null) {
const prof = profileInfo.mergeArgsForProfile(tsoProfile.profile as imperative.IProfAttrs);
iStartTso.forEach((p) => (tsoProfile.profile[p] = prof.knownArgs.find((a) => a.argName === p)?.argValue));
Expand All @@ -189,7 +188,7 @@
};
tsoParms.account = await Gui.showInputBox(InputBoxOptions);
if (!tsoParms.account) {
ZoweLogger.info(this.operationCancelled);

Check warning on line 191 in packages/zowe-explorer/src/commands/TsoCommandHandler.ts

View check run for this annotation

Codecov / codecov/patch

packages/zowe-explorer/src/commands/TsoCommandHandler.ts#L191

Added line #L191 was not covered by tests
return;
}
}
Expand Down
1 change: 0 additions & 1 deletion packages/zowe-explorer/src/commands/UnixCommandHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,14 +68,13 @@
public sshProfile: imperative.IProfileLoaded;
public isSshRequiredForProf: boolean = false;

public readonly controller: AbortController = new AbortController();
public readonly dialogs: ICommandProviderDialogs = {
commandSubmitted: vscode.l10n.t("Unix command submitted."),
defaultText: vscode.l10n.t("$(plus) Create a new Unix command"),
selectProfile: vscode.l10n.t("Select the profile to use to submit the Unix command"),
searchCommand: vscode.l10n.t("Enter or update the Unix command"),
writeCommand: (options) =>
vscode.l10n.t({

Check warning on line 77 in packages/zowe-explorer/src/commands/UnixCommandHandler.ts

View check run for this annotation

Codecov / codecov/patch

packages/zowe-explorer/src/commands/UnixCommandHandler.ts#L76-L77

Added lines #L76 - L77 were not covered by tests
message: "Select a Unix command to run against {0} (An option to edit will follow)",
args: options,
comment: ["Current work directory"],
Expand Down Expand Up @@ -138,14 +137,14 @@

await this.profileInstance.checkCurrentProfile(this.nodeProfile);
if (this.profileInstance.validProfile === Validation.ValidationType.INVALID) {
Gui.errorMessage(vscode.l10n.t("Profile is invalid"));
return;

Check warning on line 141 in packages/zowe-explorer/src/commands/UnixCommandHandler.ts

View check run for this annotation

Codecov / codecov/patch

packages/zowe-explorer/src/commands/UnixCommandHandler.ts#L140-L141

Added lines #L140 - L141 were not covered by tests
}

if (this.isSshRequiredForProf) {
await this.getSshProfile();
if (!this.sshProfile) {
return;

Check warning on line 147 in packages/zowe-explorer/src/commands/UnixCommandHandler.ts

View check run for this annotation

Codecov / codecov/patch

packages/zowe-explorer/src/commands/UnixCommandHandler.ts#L147

Added line #L147 was not covered by tests
}
const cmdArgs: imperative.ICommandArguments = this.getSshCmdArgs(this.sshProfile.profile);
// create the SSH session
Expand All @@ -155,14 +154,14 @@

const profileStatus = await this.profileInstance.profileValidationHelper(
this.sshProfile,
async (prof: imperative.IProfileLoaded, type: string): Promise<string> => {

Check warning on line 157 in packages/zowe-explorer/src/commands/UnixCommandHandler.ts

View check run for this annotation

Codecov / codecov/patch

packages/zowe-explorer/src/commands/UnixCommandHandler.ts#L157

Added line #L157 was not covered by tests
if (type !== "ssh" || prof.profile.host !== this.sshSession.ISshSession.hostname) return "unverified";
return (await zosuss.Shell.isConnectionValid(this.sshSession)) ? "active" : "inactive";
}
);

if (!this.sshSession || profileStatus !== "active") {
this.nodeProfile = undefined;

Check warning on line 164 in packages/zowe-explorer/src/commands/UnixCommandHandler.ts

View check run for this annotation

Codecov / codecov/patch

packages/zowe-explorer/src/commands/UnixCommandHandler.ts#L164

Added line #L164 was not covered by tests
ZoweLogger.error(this.unixCmdMsgs.sshSessionErrorMsg);
Gui.errorMessage(this.unixCmdMsgs.sshSessionErrorMsg);
return;
Expand Down Expand Up @@ -200,7 +199,7 @@
})
);
} else {
await AuthUtils.errorHandling(error, { apiType: ZoweExplorerApiType.Command, profile: this.nodeProfile });

Check warning on line 202 in packages/zowe-explorer/src/commands/UnixCommandHandler.ts

View check run for this annotation

Codecov / codecov/patch

packages/zowe-explorer/src/commands/UnixCommandHandler.ts#L202

Added line #L202 was not covered by tests
}
}
}
Expand All @@ -214,7 +213,7 @@
}
this.sshProfile = await this.selectServiceProfile(profiles);
if (!this.sshProfile) {
return;

Check warning on line 216 in packages/zowe-explorer/src/commands/UnixCommandHandler.ts

View check run for this annotation

Codecov / codecov/patch

packages/zowe-explorer/src/commands/UnixCommandHandler.ts#L216

Added line #L216 was not covered by tests
}
if (!(this.sshProfile.profile.host && this.sshProfile.profile.port)) {
const currentProfile = await this.profileInstance.getProfileFromConfig(this.sshProfile.name);
Expand Down
3 changes: 1 addition & 2 deletions packages/zowe-explorer/src/commands/ZoweCommandProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@

public abstract formatCommandLine(command: string, profile: imperative.IProfileLoaded): string;
public abstract runCommand(profile: imperative.IProfileLoaded, command: string): Promise<string>;
public abstract controller: AbortController;

public async issueCommand(profile: imperative.IProfileLoaded, command: string): Promise<void> {
ZoweLogger.trace("ZoweCommandProvider.issueCommand called.");
Expand Down Expand Up @@ -87,8 +86,8 @@
if (error.causeErrors) {
try {
const causeErrorsJson = JSON.parse(error.causeErrors);
formattedError += "\n" + imperative.TextUtils.chalk.bold.yellow(responseTitle);
formattedError += imperative.TextUtils.prettyJson(causeErrorsJson, undefined, false, "");

Check warning on line 90 in packages/zowe-explorer/src/commands/ZoweCommandProvider.ts

View check run for this annotation

Codecov / codecov/patch

packages/zowe-explorer/src/commands/ZoweCommandProvider.ts#L89-L90

Added lines #L89 - L90 were not covered by tests
} catch (parseErr) {
// causeErrors was not JSON.
const causeErrString: string = error.causeErrors.toString();
Expand All @@ -108,10 +107,10 @@

return formattedError;
}
return error.message;

Check warning on line 110 in packages/zowe-explorer/src/commands/ZoweCommandProvider.ts

View check run for this annotation

Codecov / codecov/patch

packages/zowe-explorer/src/commands/ZoweCommandProvider.ts#L110

Added line #L110 was not covered by tests
}
},
this.controller,
new AbortController(),
{
message: vscode.l10n.t({
message: "Welcome to the integrated terminal for: {0}",
Expand All @@ -120,7 +119,7 @@
}),
history: [...this.history.getSearchHistory()].reverse(),
startup: command,
formatCommandLine: (cmd: string) => this.formatCommandLine(cmd, profile),

Check warning on line 122 in packages/zowe-explorer/src/commands/ZoweCommandProvider.ts

View check run for this annotation

Codecov / codecov/patch

packages/zowe-explorer/src/commands/ZoweCommandProvider.ts#L122

Added line #L122 was not covered by tests
}
);
this.terminal = vscode.window.createTerminal({ name: `(${profile.name}) ${this.terminalName}`, pty: this.pseudoTerminal });
Expand Down
Loading