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

Open
wants to merge 65 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 48 commits
Commits
Show all changes
65 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
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
44 changes: 22 additions & 22 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,44 +17,44 @@
},
"dependencies": {
"@vscode/l10n": "^0.0.18",
"disposablestack": "^1.1.4"
"disposablestack": "^1.1.6"
},
"devDependencies": {
"@types/jest": "^29.2.3",
"@types/mocha": "^10.0.1",
"@types/node": "^18.19.14",
"@types/vscode": "^1.73.0",
"@typescript-eslint/eslint-plugin": "^5.53.0",
"@typescript-eslint/parser": "^5.53.0",
"@types/jest": "^29.5.14",
"@types/mocha": "^10.0.9",
"@types/node": "^18.19.64",
"@types/vscode": "^1.95.0",
"@typescript-eslint/eslint-plugin": "^5.62.0",
"@typescript-eslint/parser": "^5.62.0",
"@vscode/l10n-dev": "^0.0.35",
"@vscode/test-electron": "^1.6.0",
"@vscode/vsce": "^3.1.0",
"@vscode/test-electron": "^1.6.2",
"@vscode/vsce": "^3.2.1",
"concurrently": "^6.5.1",
"esbuild-loader": "^4.1.0",
"eslint": "^8.34.0",
"eslint-config-prettier": "^8.6.0",
"esbuild-loader": "^4.2.2",
"eslint": "^8.57.1",
"eslint-config-prettier": "^8.10.0",
"eslint-plugin-deprecation": "^2.0.0",
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-zowe-explorer": "workspace:./packages/eslint-plugin-zowe-explorer",
"fork-ts-checker-webpack-plugin": "^9.0.2",
"husky": "^6.0.0",
"jest": "^29.3.1",
"jest-html-reporter": "^3.7.0",
"jest": "^29.7.0",
"jest-html-reporter": "^3.10.2",
"jest-junit": "^15.0.0",
"jest-mock-vscode": "^3.0.5",
"jest-stare": "^2.4.1",
"jest-stare": "^2.5.2",
"madge": "^7.0.0",
"mocha": "^10.2.0",
"mocha-junit-reporter": "^2.2.0",
"mocha": "^10.8.2",
"mocha-junit-reporter": "^2.2.1",
"mocha-multi-reporters": "^1.5.1",
"node-loader": "^2.0.0",
"prettier": "^2.6.0",
"prettier": "^2.8.8",
"rimraf": "^3.0.2",
"terser-webpack-plugin": "^5.3.10",
"ts-jest": "^29.0.3",
"tsx": "^4.9.3",
"typescript": "^5.3.3",
"webpack": "^5.94.0",
"ts-jest": "^29.2.5",
"tsx": "^4.19.2",
"typescript": "^5.6.3",
zFernand0 marked this conversation as resolved.
Show resolved Hide resolved
"webpack": "^5.96.1",
"webpack-cli": "^5.1.4"
},
"pnpm": {
Expand Down
2 changes: 2 additions & 0 deletions packages/zowe-explorer-api/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,13 @@ All notable changes to the "zowe-explorer-api" extension will be documented in t
### New features and enhancements

- Update Zowe SDKs to `8.2.0` to get the latest enhancements from Imperative.
- Added individual user settings for MVS, TSO, and Unix commands. [#3079](https://github.com/zowe/zowe-explorer-vscode/pull/3079)

### Bug fixes

- Fixed an issue to review inconsistent capitalization across translation strings. [#2935](https://github.com/zowe/zowe-explorer-vscode/issues/2935)
- Fixed an issue where the `responseTimeout` profile property was ignored for z/OSMF MVS and USS API calls. [#3225](https://github.com/zowe/zowe-explorer-vscode/issues/3225)
- Updated dependecies for technical currency. [#3786](https://github.com/zowe/zowe-explorer-vscode/issues/3786)
zFernand0 marked this conversation as resolved.
Show resolved Hide resolved

## `3.0.2`

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -544,8 +544,8 @@ describe("_handleConflict", () => {
});
});
describe("_handleError", () => {
it("calls ErrorCorrelator.displayError to display error to user - no options provided", async () => {
const displayErrorMock = jest.spyOn(ErrorCorrelator.prototype, "displayError").mockReturnValue(new Promise((res, rej) => {}));
it("calls ErrorCorrelator.displayError to display error to user - no options provided", () => {
const displayErrorMock = jest.spyOn(ErrorCorrelator.prototype, "displayError").mockReturnValue(new Promise((_res, _rej) => {}));
const prov = new (BaseProvider as any)();
prov._handleError(new Error("example"));
expect(displayErrorMock).toHaveBeenCalledWith(ZoweExplorerApiType.All, new Error("example"), {
Expand All @@ -555,8 +555,8 @@ describe("_handleError", () => {
templateArgs: undefined,
});
});
it("calls ErrorCorrelator.displayError to display error to user - options provided", async () => {
const displayErrorMock = jest.spyOn(ErrorCorrelator.prototype, "displayError").mockReturnValue(new Promise((res, rej) => {}));
it("calls ErrorCorrelator.displayError to display error to user - options provided", () => {
const displayErrorMock = jest.spyOn(ErrorCorrelator.prototype, "displayError").mockReturnValue(new Promise((_res, _rej) => {}));
const prov = new (BaseProvider as any)();
prov._handleError(new Error("example"), {
additionalContext: "Failed to list data sets",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,17 @@ async function expectUnixCommandApiWithSshSession<T>(
sshobj: zosuss.SshSession
): Promise<void> {
spy.mockClear().mockResolvedValue(undefined);
spy.mockImplementation((sshobject: zosuss.SshSession, command: string, cwd: string, callback: (data: string) => void) => {
callback("test");
});
spy.mockImplementation(
(_sshobject: zosuss.SshSession, _command: string, _cwd: string, callback: (data: string) => void, _cleanStdout?: boolean) => {
callback("test");
}
);
const spywhenpathnotspecified = jest.spyOn(zosuss.Shell, "executeSsh");
spywhenpathnotspecified.mockImplementation((sshobject: zosuss.SshSession, command: string, callback: (data: string) => void) => {
callback("test");
});
spywhenpathnotspecified.mockImplementation(
(_sshobject: zosuss.SshSession, _command: string, callback: (data: string) => void, _cleanStdout?: boolean) => {
callback("test");
}
);
await apiInstance[name as string](sshobj, ...args, true, () => {});
await apiInstance[name as string](sshobj, ...args, false, () => {});
expect(spy).toHaveBeenCalled();
Expand Down Expand Up @@ -648,6 +652,12 @@ 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
16 changes: 8 additions & 8 deletions packages/zowe-explorer-api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,15 @@
},
"dependencies": {
"@types/vscode": "^1.53.2",
"@zowe/core-for-zowe-sdk": "^8.2.0",
"@zowe/imperative": "^8.2.0",
"@zowe/core-for-zowe-sdk": "^8.7.0",
"@zowe/imperative": "^8.7.0",
"@zowe/secrets-for-zowe-sdk": "^8.1.2",
"@zowe/zos-console-for-zowe-sdk": "^8.2.0",
"@zowe/zos-files-for-zowe-sdk": "^8.2.0",
"@zowe/zos-jobs-for-zowe-sdk": "^8.2.0",
"@zowe/zos-tso-for-zowe-sdk": "^8.2.0",
"@zowe/zos-uss-for-zowe-sdk": "^8.2.0",
"@zowe/zosmf-for-zowe-sdk": "^8.2.0",
"@zowe/zos-console-for-zowe-sdk": "^8.7.0",
"@zowe/zos-files-for-zowe-sdk": "^8.7.0",
"@zowe/zos-jobs-for-zowe-sdk": "^8.7.0",
"@zowe/zos-tso-for-zowe-sdk": "^8.7.0",
"@zowe/zos-uss-for-zowe-sdk": "^8.7.0",
"@zowe/zosmf-for-zowe-sdk": "^8.7.0",
"deep-object-diff": "^1.1.9",
"mustache": "^4.2.0",
"semver": "^7.6.0"
Expand Down
10 changes: 10 additions & 0 deletions packages/zowe-explorer-api/src/extend/MainframeInteraction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -500,6 +500,16 @@ export namespace MainframeInteraction {
*/
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>;

zFernand0 marked this conversation as resolved.
Show resolved Hide resolved
/**
* Issues a MVS Command and returns a Console Command API response.
*
Expand Down
4 changes: 3 additions & 1 deletion packages/zowe-explorer-api/src/profiles/UserSettings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,7 @@ export enum PersistenceSchemaEnum {
Dataset = "zowe.ds.history",
USS = "zowe.uss.history",
Job = "zowe.jobs.history",
Commands = "zowe.commands.history",
MvsCommands = "zowe.commands.mvs.history",
TsoCommands = "zowe.commands.tso.history",
UssCommands = "zowe.commands.uss.history",
zFernand0 marked this conversation as resolved.
Show resolved Hide resolved
}
27 changes: 21 additions & 6 deletions packages/zowe-explorer-api/src/profiles/ZoweExplorerZosmfApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -443,20 +443,35 @@
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 });
}

public async issueUnixCommand(command: string, cwd: string, sshSession: zosuss.SshSession): Promise<string> {
let stdout = "";
if (cwd) {
await zosuss.Shell.executeSshCwd(sshSession, command, '"' + cwd + '"', (data: string) => {
stdout += data;
});
await zosuss.Shell.executeSshCwd(
sshSession,
command,
'"' + cwd + '"',
(data: string) => {
stdout += data;
},
true
);
} else {
await zosuss.Shell.executeSsh(sshSession, command, (data: string) => {
stdout += data;
});
await zosuss.Shell.executeSsh(

Check warning on line 467 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#L467

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

Check warning on line 471 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#L470-L471

Added lines #L470 - L471 were not covered by tests
},
true
);
}
return stdout;
}
Expand Down
2 changes: 2 additions & 0 deletions packages/zowe-explorer-ftp-extension/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ All notable changes to the "zowe-explorer-ftp-extension" extension will be docum

### Bug fixes

- Updated dependecies for technical currency. [#3786](https://github.com/zowe/zowe-explorer-vscode/issues/3786)
zFernand0 marked this conversation as resolved.
Show resolved Hide resolved

## `3.0.2`

## `3.0.1`
Expand Down
4 changes: 2 additions & 2 deletions packages/zowe-explorer-ftp-extension/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@
"vscode": "^1.79.0"
},
"dependencies": {
"@zowe/zos-files-for-zowe-sdk": "^8.2.0",
"@zowe/zos-files-for-zowe-sdk": "^8.7.0",
"@zowe/zos-ftp-for-zowe-cli": "^3.0.0",
"@zowe/zos-jobs-for-zowe-sdk": "^8.2.0",
"@zowe/zos-jobs-for-zowe-sdk": "^8.7.0",
"@zowe/zowe-explorer-api": "3.1.0-SNAPSHOT",
"tmp": "0.2.3"
},
Expand Down
2 changes: 2 additions & 0 deletions packages/zowe-explorer/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ All notable changes to the "vscode-extension-for-zowe" extension will be documen

- Update Zowe SDKs to `8.2.0` to get the latest enhancements from Imperative.
- Added expired JSON web token detection for profiles in each tree view (Data Sets, USS, Jobs). When a user performs a search on a profile, they are prompted to log in if their token expired. [#3175](https://github.com/zowe/zowe-explorer-vscode/issues/3175)
- Added integrated terminals for z/OS Unix, TSO, and MVS commands which can be enabled via the `Zowe › Commands: Use Integrated Terminals` setting. [#3079](https://github.com/zowe/zowe-explorer-vscode/pull/3079)
- Add a data set or USS resource to a virtual workspace with the new "Add to Workspace" context menu option. [#3265](https://github.com/zowe/zowe-explorer-vscode/issues/3265)
- Power users and developers can now build links to efficiently open mainframe resources in Zowe Explorer. Use the **Copy External Link** option in the context menu to get the URL for a data set or USS resource, or create a link in the format `vscode://Zowe.vscode-extension-for-zowe?<ZoweResourceUri>`. For more information on building resource URIs, see the [FileSystemProvider wiki article](https://github.com/zowe/zowe-explorer-vscode/wiki/FileSystemProvider#file-paths-vs-uris). [#3271](https://github.com/zowe/zowe-explorer-vscode/pull/3271)
- Implemented more user-friendly error messages for API or network errors within Zowe Explorer. [#3243](https://github.com/zowe/zowe-explorer-vscode/pull/3243)
Expand All @@ -23,6 +24,7 @@ All notable changes to the "vscode-extension-for-zowe" extension will be documen
- Fixed issue where Zowe Explorer would present the "No configs detected" notification when initialized in a workspace without a Zowe team configuration. [#3280](https://github.com/zowe/zowe-explorer-vscode/issues/3280)
- Reduced the number of MVS API calls performed by `vscode.workspace.fs.readFile` when fetching the contents of a data set entry. [#3278](https://github.com/zowe/zowe-explorer-vscode/issues/3278)
- Fixed an issue to review inconsistent capitalization across translation strings. [#2935](https://github.com/zowe/zowe-explorer-vscode/issues/2935)
- Updated dependecies for technical currency. [#3786](https://github.com/zowe/zowe-explorer-vscode/issues/3786)
zFernand0 marked this conversation as resolved.
Show resolved Hide resolved

## `3.0.2`

Expand Down
11 changes: 10 additions & 1 deletion packages/zowe-explorer/__tests__/__mocks__/@zowe/imperative.ts
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ export interface ICommandArguments {
export interface IImperativeError {
msg: string;
errorCode?: number;
causeErrors?: any;
additionalDetails?: string;
}

Expand Down Expand Up @@ -297,13 +298,20 @@ export class ConfigUtils {
}
export class ImperativeError extends Error {
private msg: string;
constructor(public mDetails: IImperativeError) {
public causeErrors: any;
public additionalDetails: any;
constructor(private mDetails: IImperativeError) {
super();
this.msg = mDetails.msg;
this.causeErrors = this.mDetails.causeErrors;
this.additionalDetails = this.mDetails.additionalDetails;
}
public get message() {
return this.msg;
}
public get details() {
return this.mDetails;
}
}

export class ProfInfoErr extends ImperativeError {
Expand Down Expand Up @@ -420,6 +428,7 @@ export class TextUtils {
public static prettyJson(object: any, options?: any, color?: boolean, append?: string): string {
return JSON.stringify(object);
}
public static chalk = jest.requireActual("chalk");
}

export namespace SessConstants {
Expand Down
Loading
Loading