Note: I log into a device, not a computer, so I login to configuration mode (instead of non configuration mode).
I am using JSch library in Java, to login with an SSH protocol. I login like this:
channel = con.openChannel("shell");
By default the JSch does not request PTY (pseudo-terminal).
That can cause some commands to behave differently than in an interactive SSH terminal.
You can override this using the