Tiny Core Linux

Tiny Core Base => TCB Talk => Topic started by: bitpusher on December 11, 2013, 06:02:23 AM

Title: What terminal am I in? - or: pty not found
Post by: bitpusher on December 11, 2013, 06:02:23 AM
Sorry for dumb questions again, but how do I find out what terminal I'm in?

Short:
Tried pty, but shell responds: pty: not found
Looked for matching app - can't find anything.
Googled - found bazillions of stories of unfortunate people running out of ptys - but no answer to my problem.

Long:
I am using Lazarus on TinyCore and would like to debug a console application.
The IDE has a built-in output put terminal which is unfortunately an "even dumber terminal" (apart from the things it does not it converts both CR and LF to CR/LF and displays BS...)
The console debugging wiki from Lazarus tells me:

Open a terminal outside of Lazarus and run
 pty

It should return something like
 /dev/pty/2

and then use output redirection.

I would like to follow this advice, however I already fail at pty...


Title: Re: What terminal am I in? - or: pty not found
Post by: gerald_clark on December 11, 2013, 06:18:58 AM
Console runs on a tty.  X terminals run on a pty.
Try the 'tty' command instead.
Title: Re: What terminal am I in? - or: pty not found
Post by: bmarkus on December 11, 2013, 06:44:07 AM
Console runs on a tty.  X terminals run on a pty.
Try the 'tty' command instead.

X terminals run on pts/n where n is 0, 1, ... See

Code: [Select]
who
command in a terminal. pty is for pseudo terminals.
Title: Re: What terminal am I in? - or: pty not found
Post by: gerald_clark on December 11, 2013, 06:55:25 AM
A pts is a pty.
See the pts and pty  man pages.
Title: Re: What terminal am I in? - or: pty not found
Post by: bitpusher on December 12, 2013, 12:48:55 AM
OK, mission accomplished.

In case somebody else could need this sometime:
Upon entering tty a urxvt answered /dev/pts/3 .
The "real" textmode terminal (Ctrl-Alt-F1) gave me /dev/tty1.

In Lazarus (1.0.8) both work perfectly for debugger ConsoleTty as described in http://wiki.freepascal.org/Debugger_Console_App (http://wiki.freepascal.org/Debugger_Console_App)