LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   After running my program, it fails and gives my terminal strange characters that I ca (https://www.linuxquestions.org/questions/programming-9/after-running-my-program-it-fails-and-gives-my-terminal-strange-characters-that-i-ca-478780/)

RHLinuxGUY 08-30-2006 09:32 AM

After running my program, it fails and gives my terminal strange characters that I ca
 
The problem in detail: I am making a game, the loads a bunch of images except for some reason, one image fails even though it is the same as the others. Well that is the not problem, (or it could be) the problem is after it fails, it kicks me back to my command line, except it wierd characters. Here is what it looks like:

Code:

george@geotop ~/SpaceCarnage/Aug2306 $ ./spacecarnage.unstable
dsz = tiles/environment/gravel_whole0.bmp
dsz = tiles/environment/gravel_whole0.bmp
dsz = tiles/environment/gravel_whole0.bmp
dsz = tiles/environment/gravel_whole0.bmp
dsz = tiles/environment/gravel_whole0.bmp
dsz = tiles/environment/gravel_whole0.bmp
dsz = tiles/environment/gravel_whole0.bmp
dsz = tiles/environment/gravel_whole0.bmp
dsz = tiles/environment/gravel_whole0.bmp
dsz = tiles/environment/gravel_whole0.bmp
dsz = tiles/environment/gravel_slope0.bmp
dsz = tiles/environment/gravel_slope0.bmp
dsz = tiles/environment/gravel_slope0.bmp
dsz = tiles/environment/gravel_slope0.bmp
dcsz = tiles/environment/gravel_whole0.bmp
dcsz = tiles/environment/gravel_whole0.bmp
dcsz = tiles/environment/gravel_whole0.bmp
dcsz = tiles/environment/gravel_whole0.bmp
dcsz = tiles/environment/gravel_whole0.bmp
dcsz = tiles/environment/gravel_whole0.bmp
dcsz = tiles/environment/gravel_whole0.bmp
dcsz = tiles/environment/gravel_whole0.bmp
dcsz = tiles/environment/gravel_whole0.bmp
dcsz = tiles/environment/gravel_whole0.bmp
dcsz = tiles/environment/gravel_slope0.bmp
dcsz = tiles/environment/gravel_slope0.bmp
dcsz = tiles/environment/gravel_slope0.bmp
dcsz = tiles/environment/gravel_slope0.bmp
dcsz = (�
C⎺┤┌␍ ┼⎺├ ┌⎺▒␍ ␉└⎻! SDL_G␊├E⎼⎼⎺⎼, C⎺┤┌␍┼'├ ⎺⎻␊┼ (ã : ┴⎺␋␍ U⎻␍▒├␊O␉┘R␊␌├⎽() : 1 :
±␊⎺⎼±␊@±␊⎺├⎺⎻ ·/S⎻▒␌␊C▒⎼┼▒±␊/A┤±2306 $

I'm pretty confident you guys can see the last characters. I cannot change it, because I dont' know how, except by restarting the terminal. Anyways, what should I do? Is this something that is programming related? or terminal related?

dive 08-30-2006 09:50 AM

You should be able to get terminal back to norm with the 'reset' command, but that doesn't really solve your problem.

Something in your code is probably doing this - is this a bash script game? Perhaps running bash with -x (debugging) would help?

Or post some code here for people to look into perhaps.

haertig 08-30-2006 10:00 AM

Looks like your spacecarnage program sent some binary garbage out to the terminal, which just coincidently happened to throw your terminal into an alternate graphics mode. You get this type of behavior frequently when you do something like "cat <binary_file>". Terminals don't like displaying binary data.

You can sometimes, very rarely, recover by typing "stty sane" at the command line. You won't see these words appear as you type them - you'll see weird characters displayed instead. Just type blindly and accurately.

This probably won't work. So you kill the terminal and start a new one, just like you're doing now.

The real fix is to debug your spacecarnage program and stop it from sending binary data out to the terminal.

RHLinuxGUY 08-30-2006 05:11 PM

Thank for you the responses, and I have fixed my game. I don't know exactly where the problemed stemed, but it was just a declaring of a new struct object but without initializing any variable with information. So SDL_GetError() might have had something to do with outputting gibberish, but don't take a newbxorx word for it. Again thanks for the help guys, those commands can help me.

[quote]:q :q! :wq :w :w! :wq! :quit :quit! :help help helpquit quit quithelp
:quitplease :quitnow :leave ^X^C ^C ^D ^Z ^Q QUITDAMMIT ^[:wq[/quot]

haha! Shift ZZ? Why do people do things the hard way? Just pull the plug. Everything quits.

reddazz 08-31-2006 04:24 AM

Moved: This thread is more suitable in the Programming Forum and has been moved accordingly to help your thread/question get the exposure it deserves.


All times are GMT -5. The time now is 02:58 PM.