The file /dev/tty is a character file with major number 5 and minor number 0, usually of mode 0666 and owner.group root.tty. It is a synonym for the controlling terminal of a process, if any.

Home » Language IDEs » C / C++ IDE (CDT) » /dev/tty: Device not configured on running command line tool in makefile
Show:Today's Messages::Show Polls::Message Navigator
/dev/tty: Device not configured on running command line tool in makefile[message #208792]Tue, 29 January 2008 13:08
Kustaa Nyholm
Messages: 13
Registered: July 2009
I'm setting up my embedded development system using CDT.
My build is based on a manually maintained makefile.
The very last thing my build does is to invoke a command line utility
(bl08) to download the code (via serial port) to the target device. After
download the bl08 tool goes into terminal emulator mode passing
everything from the console keyboard port to the target device and
everything from the target back to the console (using the serial port).
To access the the console, the bl08 tool opens (its written in C) the
console as '/dev/tty'. This seems to work for the output as I see the
output in the eclipse console view. However, when the bl08 code tries to
enter the terminal mode and open the '/dev/tty' to receive input from the
console it aborts with:
/dev/tty: Device not configured
So how can I get input from the console?
I'm also open other suggestions. Like somehow creating a run configuration
to call the bl08.
I've tried to create a run configuration that will launch
./hc08/bloader/bl08 and this fails
with Error within DebugUI / InvokationTargetExcetion.
So basically this is very simple, I want to launch an external application
from within the Eclipse with a keyboard short cut. It would be nice if it
would use the console view, but that is not absolute necessary, a separate
terminal window is just fine.
I'm doing this on Mac OS 10.4.11 / Eclipse 3.3.1.1 / CDT 4.0.2
br Kusti
Re: /dev/tty: Device not configured on running command line tool in makefile[message #208801 is a reply to message #208792]Tue, 29 January 2008 13:37
Eclipse User
Originally posted by: dmsubs.NOSPAM.consertum.com
Have you tried Run->External Tools?
--
Derek
Kustaa Nyholm wrote:
> I'm setting up my embedded development system using CDT.
> My build is based on a manually maintained makefile.
> The very last thing my build does is to invoke a command line utility
> (bl08) to download the code (via serial port) to the target device.
> After download the bl08 tool goes into terminal emulator mode passing
> everything from the console keyboard port to the target device and
> everything from the target back to the console (using the serial port).
>
> To access the the console, the bl08 tool opens (its written in C) the
> console as '/dev/tty'. This seems to work for the output as I see the
> output in the eclipse console view. However, when the bl08 code tries to
> enter the terminal mode and open the '/dev/tty' to receive input from
> the console it aborts with:
>
> /dev/tty: Device not configured
>
> So how can I get input from the console?
>
> I'm also open other suggestions. Like somehow creating a run
> configuration to call the bl08.
> I've tried to create a run configuration that will launch
> ./hc08/bloader/bl08 and this fails
> with Error within DebugUI / InvokationTargetExcetion.
>
> So basically this is very simple, I want to launch an external
> application from within the Eclipse with a keyboard short cut. It would
> be nice if it would use the console view, but that is not absolute
> necessary, a separate terminal window is just fine.
>
> I'm doing this on Mac OS 10.4.11 / Eclipse 3.3.1.1 / CDT 4.0.2
>
> br Kusti
>
>
>
>
Re: /dev/tty: Device not configured on running command line tool in makefile[message #208816 is a reply to message #208801]Wed, 30 January 2008 06:33
Kustaa Nyholm
Messages: 13
Registered: July 2009
Yes,
or actually no, I had only tried to create a run/debug launch
configuration, but now I'v tried the External tool option as well and I
get the same error. The bootloader (bl08) runs fine until it tries to open
'/dev/tty' to get some input.
Thanks for the tip though, I had overlooked that.
br Kusti
Re: /dev/tty: Device not configured on running command line tool in makefile[message #208820 is a reply to message #208816]Wed, 30 January 2008 07:50
Eclipse User
Originally posted by: dmsubs.NOSPAM.consertum.com
Why are you trying to open /dev/tty? Why not just use stdin? Using /dev/tty
would mean you can never use it in a pipe or use redirection. e.g. my_app <file
will never work.
When Eclipse starts a task, it sets up pipes for stdin, stdout and stderr.
--
Derek
Kustaa Nyholm wrote:
> Yes,
>
> or actually no, I had only tried to create a run/debug launch
> configuration, but now I'v tried the External tool option as well and I
> get the same error. The bootloader (bl08) runs fine until it tries to
> open '/dev/tty' to get some input.
>
> Thanks for the tip though, I had overlooked that.
>
> br Kusti
>
>
>
>
>
Re: /dev/tty: Device not configured on running command line tool in makefile[message #208878 is a reply to message #208820]Wed, 30 January 2008 14:29
Kustaa Nyholm
Messages: 13
Registered: July 2009
Derek Morris wrote:
> Why are you trying to open /dev/tty? Why not just use stdin? Using /dev/tty
> would mean you can never use it in a pipe or use redirection. e.g. my_app
<file
> will never work.
> When Eclipse starts a task, it sets up pipes for stdin, stdout and stderr.
Well, my simple bootloader is not threaded and doing getchar() would block
preventing me from transferring data from serial port to stdout (or
/dev/tty). I'm using select() to wait on the input streams (or what do you
callem).
But your suggestion ringed a bell. Just a few days ago I was struggling
with the problem that I could not get my bootloader to work with
/dev/console and someone on the mac linux porting list suggested using
/dev/tty instead and someone else pointed out that one can use special
file descriptiors 0 for stdin and 1 for std out in calls to FS_SET/select
etc. I chose the former option, but right now I tested the later option.
And bingo, it works! Great!
Now I can run my bootloader/terminal emulator in the Eclipse console view.
Only thing is that the input from the keyboard is line oriented but that's
actually very nice and input is not that much used anyway. The input also
seems to strip CTRL-C so my tool won't quit but it is trivial to kill it.
Now if I can only figure out how I can tie the ext tool to a function
key..
Derek, thanks for your help in solving this problem.
br Kusti
Previous Topic:C++ / Python / SWIG
Next Topic:CDT automake project enable debug
Goto Forum:
-=] Back to Top [=-

Current Time: Sat Apr 18 15:56:07 GMT 2020

Powered by FUDForum. Page generated in 0.01388 seconds

Windows SSH client to Linux/Unix/macOS (*nix) SSH server

If you want to have the best experience while using utilities like vi, top, man, etc. while connected from a Windows SSH client to a *nix server, you should configure your terminal to use an xterm-like rendering mode.

Unfortunately, this rendering mode is only included with Windows 10. If you're not on Windows 10, you may have more luck using a third-party terminal emulator or console host like Cmder or ConEmu.

  1. Open a shell from which you want to use ssh (either powershell or cmd).

  2. Right-click the application icon in the upper-left and the window and select Properties.

  3. Ensure that Use legacy console (requires relaunch) is unchecked:

  4. In the Layout tab, set the Screen Buffer width and Window Size width to >= 90:

    All of these changes will persist within the same shortcut to cmd or powershell.If you want to change the defaults for new shortcuts, select Defaults in Step 2 instead of Properties.

  5. Set the TERM environment variable to xterm:

    The integrated sequencer and the sequenced patches inspire your musical potential.Forget Everything but Music.PURITY makes you concentrate on your music without being annoyed about anything not related to music. Enter the Next Generation.PURITY is a next generation of digital musical instrument workstation and PCM sound module software. PURITY is based on well-sampled PCM wave data including a lot of sound of hardware workstations, sound modules, drum machines, vintage analog synths and even modern digital synths. PURITY is designed to realize and surpass the hardware musical instrument workstation perfectly on computer-based music production environments offering higher sound quality and more usability.Come to the Front.PURITY provides rich sound sources to create professional music of any kind and any purpose. Moreover, PURITY comes with over 1,300 ready-to-use sound presets that are most popular in each era of the electronic music. Vst plugins free download.

    In PowerShell you can also use the $env: namespace to edit this variable:

    Both of these methods will only persist for the current session.If you want this to happen every time you start PowerShell, you can leverage PowerShell profiles.

    If the TERM environment variable is not found then the SSH client code sets the TERM as 'xterm-256color' for the duration of SSH session.

Linux/Unix/macOS SSH client to Windows SSH server

  1. Set the TERM environment variable to xterm:

Windows SSH Client to Windows SSH server

Dev
  1. Set the non-legacy console mode in the console properties,
    Make sure you uncheck the 'use legacy console'

  2. Set the Screenbuffer width, window size width to >= 90.

  3. If your windows client machine is **windows 10 or above ** and if you have any issues,

    a) exit the current ssh session (if any)

    b) set the environment variable SSH_TERM_CONHOST_PARSER to 0
    c:test> set SSH_TERM_CONHOST_PARSER=0
    c:test> set SSH_TERM_CONHOST_PARSER (This should show '0') Antares harmony engine vst rtas v1 0 full cracked.

    c) start a new ssh session.

    d) if you are NOT able to reproduce then it is the windows 10 console issue. Please let us know by filing an issue, so that we will update the known issues. FYI, the fix should come from the windows 10 console team but not from the SSH team.

    e) if you are able to reproduce then file an issue.

Known windows 10 console issues (These will be fixed by the windows console team)

When connected to unix ssh server

a) vim command, intermittently the file is opened in the Replace mode.
b) top command, clears the previous screen contents.
c) window resize is not supported because of a bug in conhost.exe (conhost.exe is a windows 10 module to parse ANSI sequences).

When connected to windows ssh server and using powershell

a) while executing an unknown command (abcdef) in the powershell, the last line ( + FullyQualifiedErrorId : CommandNotFoundException) is not displayed on the console

PTY

Windows OS does not have inbuilt support for a pseudoterminal.

Windows version of OpenSSH server implements a VT100 PTY by intercepting Windows Console events. This is implemented in ssh-shellhost.exe, connected to sshd via std i/o. At a high level, ssh-shellhost.exe acts as an intermediary between sshd and a Windows console applications performing the following:

  • interprets incoming VT100, processes and calls Windows Console IO
  • processes Windows Console (output) event queue, translates them to VT100 and spits out on stdout.

TTY

Windows console previously did not have the capability to process any incoming terminal control codes. Support for xterm is added in Windows 10.

To support downlevel platforms (down till Windows 7), a VT100 interpreter is implemented in Windows OpenSSH client (ssh.exe) to support typical TTY scenarios. Although this works well when talking to Windows targets, there are limitations and known issues when dealing with interactive applications on Unix like top, vi, etc.

C Open Dev Tty Online

If you are using the openssh client,
a) Windows 10+ OS then windows console (cmd.exe/powershell) has the support to interpret the VT sequences received from the SSH server. We simply pass the raw VT sequences to the console (cmd.exe/powershell). If you are facing any issues then it should be fixed by the windows console team.

C Open Dev Tty File

b) Prior versions of windows 10 OS, the raw VT sequences will be parsed by the inbuilt VT100 ANSI parser that's part of the ssh.exe. We have fixed most of the issues. We have no plans to extend to VT100+ sequences.

Testing

We have tested different scenarios,

C++ Open /dev/tty

  1. Windows client (cmd.exe / powershell) to windows server
  2. Windows client (cmd.exe / powershell) to Linux server
  3. Linux client to windows server
  4. Third party ssh tools like putty/Cygwin to windows server

While making any terminal code changes, please make sure below manual test cases are passed

  1. All the arrow key functions should work properly (up, down, left and right arrows).
  2. The backspace, delete, home, end functions keys should work properly.
  3. 'cls' should clear only the visible window (windows 10+ OS) / should clear entire buffer (prior versions of windows 10 OS).
  4. When connected to unix ssh server, the basic commands like vi, top, man, clear, etc should work properly.