vscode-ibmi icon indicating copy to clipboard operation
vscode-ibmi copied to clipboard

Cursor keys not working on 5250 terminal.

Open robinsg opened this issue 2 years ago • 12 comments

When I open a 5250 terminal from Code for i I am unable to use the up, down, left and right cursor keys. They just seem to print escape character instead of moving the cursor.

I have the 5250 session type set as default except for the language which is set to 285. The matches my user profile language settings . . . the way I have set them for the last 4 decades 🤣.

I'm running VSC on Windows 11.

Any suggestions how I fix the cursor key mappings?

Thanks.

robinsg avatar May 02 '22 14:05 robinsg

@robinsg Did you play around with the tn5250 settings in the Connection settings of your connection? I am not sure what might solve it but that might be a good place to start!

worksofliam avatar May 03 '22 12:05 worksofliam

I had default and 37 originally but I also tried 3477-FC and 285 but these don't make any difference.

Pressing left, right, up and down cursor keys show the following:

[A[B[C[D

I also have ACS installed and that works fine.

robinsg avatar May 03 '22 13:05 robinsg

@robinsg Does the same happen if you ssh into the system using another client and then launching tn5250?

worksofliam avatar May 03 '22 13:05 worksofliam

No, it works fine.

I use MobaXterm to SSH in to my LPARs. If I then run TN5250 from the SSH session it works as expected.

Glenn Robinson

IBM Storage and Power Systems Specialist RSI Consulting Limited Tel: + 44 7930 946274 Email: @.***

On Tue, 3 May 2022 at 14:10, barry @.***> wrote:

@robinsg https://github.com/robinsg Does the same happen if you ssh into the system using another client and then launching tn5250?

— Reply to this email directly, view it on GitHub https://github.com/halcyon-tech/vscode-ibmi/issues/662#issuecomment-1116079664, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACBSEE3HQI2DNBNB3E5QFDDVIEQUJANCNFSM5U4G3U7Q . You are receiving this because you were mentioned.Message ID: @.***>

robinsg avatar May 03 '22 13:05 robinsg

Must be something about the way the 5250 session starts up from within VS Code. Terminal type possibly ? I have the same issue if I start a 5250 session directly. If I open the PASE terminal and then start a 5250 session it works.

Update: When I close VS Code, restart it and connect to a 5250 terminal right away the arrow keys don't work, but if I Control-Q to exit TN5250, press the up arrow to get last command: TERM=xterm /QOpenSys/pkgs/bin/tn5250 Then press enter to start tn5250 and the arrow keys work. Not sure what it is about that initial start of 5250. Very wierd. Saw the same on Windows and Mac

richardschoen avatar May 04 '22 18:05 richardschoen

I'm wondering if this has anything to do with the shell program when TN5250 is first started. Does VSC run ksh or bash as the shell?

I'm clutching at straws but I can confirm that using your workaround does indeed work.

robinsg avatar May 04 '22 21:05 robinsg

@robinsg Perhaps it's got something do with the fact I am forcing the users TERM to be xterm.

Try the following:

  • TERM=xterm /QOpenSys/pkgs/bin/tn5250 ... to see if you get the same issue
  • /QOpenSys/pkgs/bin/tn5250 to see if the issue goes away.

Maybe I need to remove the hard coded TERM.

worksofliam avatar May 07 '22 22:05 worksofliam

Might be worth a try. However see my previous comment. If you exit with Control-Q and run the same sequence with XTERM it works fine the second time when run manually from the same PASE session you started. Interesting....

richardschoen avatar May 07 '22 22:05 richardschoen

For me personally I just start a PASE session and do this in a start5250.sh script:

#!/QopenSys/pkgs/bin/bash
export term=xterm
tn5250 ssl:localhost:992

richardschoen avatar May 07 '22 22:05 richardschoen

Hey @robinsg - any update on this? How is it going?

worksofliam avatar May 16 '22 21:05 worksofliam

No further progress I'm afraid. I was hoping that putting export TERM=xterm at the top of my .profile file might fix this but no luck.

When I first set up the OSS environments on these LPARs a few years back I used QSYS2.SET_PASE_SHELL_INFO() to set my shell to bash and then set up my .profile and .bashrc files. Any thoughts on that method for setting up the bash environment using that method?

robinsg avatar May 17 '22 04:05 robinsg

Exact same problem here, PUB400 untouched profile.

Exiting then launching with XTERM=xterm ... thing works fine. Exiting then launching without any XTERM gives a black-and-white 5250, cursor keys working but no function keys ...

BallonLac avatar Jul 22 '22 05:07 BallonLac

I believe this issue to be fixed. @robinsg i am going to close the issue, but please feel free to open again if you feel otherwise.

worksofliam avatar Nov 19 '22 04:11 worksofliam