LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 08-30-2006, 10:32 AM   #1
RHLinuxGUY
Member
 
Registered: Oct 2003
Distribution: Ubuntu 7.04
Posts: 889
Blog Entries: 1

Rep: Reputation: 30
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?
 
Old 08-30-2006, 10:50 AM   #2
dive
Senior Member
 
Registered: Aug 2003
Location: UK
Distribution: Slackware
Posts: 3,211

Rep: Reputation: 293Reputation: 293Reputation: 293
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.
 
Old 08-30-2006, 11:00 AM   #3
haertig
Senior Member
 
Registered: Nov 2004
Distribution: Debian, Ubuntu, LinuxMint, Slackware, SysrescueCD
Posts: 2,032

Rep: Reputation: 309Reputation: 309Reputation: 309Reputation: 309
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.
 
Old 08-30-2006, 06:11 PM   #4
RHLinuxGUY
Member
 
Registered: Oct 2003
Distribution: Ubuntu 7.04
Posts: 889
Blog Entries: 1

Original Poster
Rep: Reputation: 30
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.
 
Old 08-31-2006, 05:24 AM   #5
reddazz
Guru
 
Registered: Nov 2003
Location: N. E. England
Distribution: Fedora, CentOS, Debian
Posts: 16,298

Rep: Reputation: 73
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Question about running a program from terminal window ganoo Linux - Newbie 7 11-01-2010 01:44 PM
Wine: How do I input into a running Wine Program with Cyrillic Characters? Riddick Linux - Software 3 08-16-2009 12:58 PM
Running a Program in a new Virtual Terminal Johnsernickle Linux - Software 2 07-09-2004 12:50 PM
Running program when terminal closed? mikeshn Linux - General 9 11-23-2002 09:00 PM
Strange Characters : RedHat 8.0 UberPhreek Linux - Newbie 1 10-18-2002 06:58 AM


All times are GMT -5. The time now is 08:53 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration