I'm writing a BBS terminal program. And have hit a major roadblock. My terminal works fine for every BBS out there, except Mystic BBSes. I've narrowed down the problem to the usage of the stty() command. The problem is so: I cannot use the arrow keys to select certain things on Mystic BBSes. It doesn't seem to be sending the ^[[A, ^[[B, etc ANSI codes to the screen. Here's the strange part, If I press the arrow key multiple times, it will do what it's supposed to do, and traverse the menus. Now, back to stty(), I wrote another program, this time, in Python, and had this exact problem with it. I solved it by putting a
before the command to connect to the BBS. Now back to the problem, I have no idea where I should put this system() call. Trial and error hasn't helped much.
Any and all input is greatly appreciated. And a big THANK YOU to everyone who has helped me get this far. You know who you are.
Using stty raw is only half of the problem. When the BBS software exits, you need to restore the stty settings to what they were before you went into raw mode before returning to your user.
If you ever get stuck because a program exited while in raw mode, you can get back to a semi-sane setting by using:
where CTL-J means hold down the CTL or control key on your keyboard and while you are holding it down hit and release the J key (and then you can release the control key). After you have entered the first line of that, hopefully you will be back in a sane cooked state, but there is a good chance that the erase and kill characters that you are used to using have not been reset to the values you expect. The stty -a output will tell you what stty sane set up for you.
It would be a good idea to run stty -a and look at the stty man page on your system so you can understand what the output you see from stty -a means. The stty utility is covered by the standards, but the output format varies from operating system to operating system.
You haven't said what language you're using for this project. If you were writing standard shell code to invoke your Mystic BBS software and we make the wild assumption that you do so by invoking a utility named mystic, you would want something like:
Hope this helps.
Last edited by Don Cragun; 04-12-2019 at 11:05 PM..
Reason: Fix suggestion...
This User Gave Thanks to Don Cragun For This Post:
If you're using C instead of shell code, look at the man pages for the tcgetattr() and tcsetattr() functions on your system. Those functions (and others you will find in their SEE ALSO sections or on the same pages) are used by the stty utility to get its job done.
Also, I may not have mentioned it. But this is actually a terminal program for connecting to other BBSes.. The solution I posted was a solution for the Python project. I still can't get things working with the C version. Sorry, I did not make myself clear enough on that.
Thanks.
--- Post updated at 02:25 AM ---
Quote:
Originally Posted by Don Cragun
If you're using C instead of shell code, look at the man pages for the tcgetattr() and tcsetattr() functions on your system. Those functions (and others you will find in their SEE ALSO sections or on the same pages) are used by the stty utility to get its job done.
:confused:
when i tried to look the status of DNS-client, it is in maintenance mode.....
Please tell me how to bring it back to online mode...PLEASE TELL ME STEP BY STEP.... PLEASE...
:wall: (2 Replies)
Hi ,
I have shell scripting in linux box. This script is mentioned that should be run under the one particular user. If you run that mentioned user location then it is working fine....
Suppose if you are trying run from some other user like as mentioned below
sudo su - gxadm -c script.sh
... (1 Reply)
Hi All,
Can please let me know what is the difference between the single line mode and multi line mode in regular expresions?
Thanks,
Chidhambaram B (3 Replies)
Hello,
I am trying to configure a serial port, for mac os x 10.6. I believe I can use the stty command to look at serial port configuration and or change the serial port settings. I read the man page, but I don't really know what I am doing. Any help? (0 Replies)
Hi All,
I used to have my suse linux(VM) server in graphic mode but not anymore since morning. I cant rolback since i loose somuch work. Any idea how to it back to normal. Thanks (6 Replies)
I am trying to set my backspace key as the erase key
right now I have to type CONTROL-H to delete.
Can you please tell me the command to set my backspace
as the erase key...... (1 Reply)