# ghci: output is not on a new line



## lubos (Jan 21, 2012)

Hello,

I am using the Haskell interpreter ghci under FreeBSD. I am not sure whether it is the proper behavior, but any output is not written on a new line, but the current line is rewritten. For example after
[CMD="ghci>"]5+5[/CMD]
I see

```
10ci>
```
on the same line... Can I change it somehow?

Thank you in advance,

Lubos


----------



## fonz (Jan 21, 2012)

lubos said:
			
		

> I am not sure whether it is the proper behavior, but any output is not written on a new line, but the current line is rewritten.


That's certainly not proper behaviour. I seem unable to reproduce your problem (in other words: it works fine for me), so I can only guess at what's causing it. I think it's either a bug in lang/ghc itself or a faulty terminal setting.

Where/how are you running ghci? On the console or in a terminal emulator? In the latter case, which one? What does `% printenv TERM` (or your shell's equivalent thereof if you're not using tcsh) say? Are you logged in directly or via SSH? In the former case, did you start ghci manually from a shell or did you launch it from a WM/DE menu of some sort? Does the problem still occur when you run ghci in another way (e.g. on the console instead of a terminal emulator, or in a different terminal emulator, or from a shell instead of a WM/DE menu, etc.), in other words: does it *always* happen?

If you're certain that the problem is not caused by a faulty terminal setting, I'd suggest updating your ports tree and rebuilding lang/ghc. That might take a while, though.

Fonz


----------



## lubos (Jan 22, 2012)

fonz said:
			
		

> Where/how are you running ghci? On the console or in a terminal emulator? In the latter case, which one?



Thanks for your reply. I am using cons25. I have figured out that - no matter on which shell - after clearing screen with CTRL+L this behavior disappears until reaching the bottom of the screen again.

Knowing this, it is easy for me to avoid that and it does not bring such inconvenience.


----------



## wblock@ (Jan 22, 2012)

Did you install from the port?  There may be FreeBSD-specific patches in the port to fix the problem.


----------



## fonz (Jan 22, 2012)

I did some more tests with lang/ghc built from a freshly updated ports tree on 8.2-RELEASE. The problem appears to only occur with cons25.

@lubos: As a workaround, you could set $TERM to something else (vt100, xterm, etc.) before starting ghci.

Fonz


----------



## lubos (Jan 22, 2012)

wblock@ said:
			
		

> Did you install from the port?  There may be FreeBSD-specific patches in the port to fix the problem.



No, I used the package.


----------



## lubos (Jan 22, 2012)

fonz said:
			
		

> As a workaround, you could set $TERM to something else (vt100, xterm, etc.) before starting ghci.



It may be a workaround, but it works, thanks!


----------

