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

Interactive TSO mode #2444

Open
adam-wolfe opened this issue Feb 24, 2025 · 1 comment
Open

Interactive TSO mode #2444

adam-wolfe opened this issue Feb 24, 2025 · 1 comment
Labels
enhancement New feature or request priority-low Legit issue but cosmetic or nice-to-have

Comments

@adam-wolfe
Copy link
Contributor

adam-wolfe commented Feb 24, 2025

Is your feature or enhancement request related to a problem or limitation? Please describe

In order to issue consecutive TSO commands on the same address space using Zowe CLI, I need to issue the first command, copy the address space, then send additional data/commands using subsequent Zowe CLI commands and using the address space from my initial command. This workflow is a bit counterintuitive for somebody using Zowe CLI in a terminal and makes it difficult to respond to TSO prompts, work with REXX scripts, etc.

Describe your enhancement idea

Add a command to the zowe zos-tso command group that starts a looping prompt that:

  1. Creates an address space
  2. Allows the user to enter data/commands
  3. Sends the data/commands to TSO
  4. Gets any output from TSO and prints it to stdout in the terminal
  5. Repeats 2-4 until the user issues an interrupt (ctrl+c)
  6. Stops the address space

Describe alternatives you've considered

No alternative exists within Zowe CLI. Users could build a script to do this kind of thing.

Provide any additional context

As a temporary solution, for those interested in a sample Python script (tested on Windows with Python 3.12) that provides this kind of interactive TSO behavior:

import subprocess
import shlex

# Note: Zowe CLI must be running in daemon mode

# Execute a console command defined by the cmd parameter and returns the command output (stdout)
def issue_cmd(cmd: str) -> str:
    return subprocess.run(shlex.split(cmd), stdout=subprocess.PIPE).stdout.decode('utf-8').strip()

# Initialize a TSO address space
key = issue_cmd("zowe tso start as --sko")

if(key != ''): # Confirm that we have an address space key
    try:
        while(1): # Loop until we receive a keyboard interrupt (CTRL+C)
            print(issue_cmd('zowe tso send as ' + key + ' --data "' + input('> ') + '"'))
    except KeyboardInterrupt:
        print('Got keyboard interrupt. Stopping address space...')
        issue_cmd('zowe tso stop as ' + key) # Stop the address space
else:
    print('Failed to initialize TSO address space. Exiting...')
@adam-wolfe adam-wolfe added enhancement New feature or request new The issue wasn't triaged yet labels Feb 24, 2025
@github-project-automation github-project-automation bot moved this to New Issues in Zowe CLI Squad Feb 24, 2025
Copy link

Thank you for raising this enhancement request.
The community has 90 days to vote on it.
If the enhancement receives at least 5 upvotes, it is added to our development backlog.
If it receives fewer votes, the issue is closed.

@JTonda JTonda added priority-low Legit issue but cosmetic or nice-to-have and removed new The issue wasn't triaged yet labels Feb 24, 2025
@zowe-robot zowe-robot moved this from New Issues to Low Priority in Zowe CLI Squad Feb 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request priority-low Legit issue but cosmetic or nice-to-have
Projects
Status: Low Priority
Development

No branches or pull requests

2 participants