WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: What terminal am I in? - or: pty not found  (Read 1913 times)

Offline bitpusher

  • WikiUser
  • *
  • Posts: 33
What terminal am I in? - or: pty not found
« 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...



Offline gerald_clark

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 4254
Re: What terminal am I in? - or: pty not found
« Reply #1 on: December 11, 2013, 06:18:58 AM »
Console runs on a tty.  X terminals run on a pty.
Try the 'tty' command instead.

Offline bmarkus

  • Administrator
  • Hero Member
  • *****
  • Posts: 7022
    • My Community Forum
Re: What terminal am I in? - or: pty not found
« Reply #2 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.
« Last Edit: December 11, 2013, 06:45:38 AM by bmarkus »
Béla
Ham Radio callsign: HA5DI

"Amateur Radio: The First Technology-Based Social Network."

Offline gerald_clark

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 4254
Re: What terminal am I in? - or: pty not found
« Reply #3 on: December 11, 2013, 06:55:25 AM »
A pts is a pty.
See the pts and pty  man pages.

Offline bitpusher

  • WikiUser
  • *
  • Posts: 33
Re: What terminal am I in? - or: pty not found
« Reply #4 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