Coder Social home page Coder Social logo

mtm's Introduction

Introduction

mtm is the Micro Terminal Multiplexer, a terminal multiplexer.

It has four major features/principles:

Simplicity

There are only a few commands, two of which are hardly ever used. There are no modes, no dozens of commands, no crazy feature list.

Compatibility

mtm emulates a classic ANSI text terminal. That means it should work out of the box on essentially all terminfo/termcap-based systems (even pretty old ones), without needing to install a new termcap entry.

Size

mtm is small. The entire project is around 1000 lines of code.

Stability

mtm is "finished" as it is now. You don't need to worry about it changing on you unexpectedly. The only changes that can happen at this point are:

  • Bug fixes.
  • Translation improvements.
  • Accessibility improvements.
  • Fixes to keep it working on modern OSes.

Community

Rob posts updates about mtm on Twitter at http://twitter.com/TheKingAdRob.

Installation

Installation and configuration is fairly simple:

  • You need ncursesw. If you want to support terminal resizing, ncursesw needs to be compiled with its internal SIGWINCH handler; this is true for most precompiled distributions. Other curses implementations might work, but have not been tested.
  • Edit the variables at the top of the Makefile if you need to (you probably don't).
  • If you want to change the default keybindings or other compile-time flags, copy config.def.h to config.h and edit the copy. Otherwise the build process will use the defaults.
  • Run:

    make

    or:

    make CURSESLIB=curses

    or:

    make HEADERS='-DNCURSESW_INCLUDE_H="<ncurses.h>"'

    whichever works for you.

  • Run make install if desired.

Usage

Usage is simple:

mtm [-T NAME] [-t NAME] [-c KEY]

The -T flag tells mtm to assume a different kind of host terminal.

The -t flag tells mtm what terminal type to advertise itself as. Note that this doesn't change how mtm interprets control sequences; it simply controls what the TERM environment variable is set to.

The -c flag lets you specify a keyboard character to use as the "command prefix" for mtm when modified with control (see below). By default, this is g.

Once inside mtm, things pretty much work like any other terminal. However, mtm lets you split up the terminal into multiple virtual terminals.

At any given moment, exactly one virtual terminal is focused. It is to this terminal that keyboad input is sent. The focused terminal is indicated by the location of the cursor.

The following commands are recognized in mtm, when preceded by the command prefix (by default ctrl-g):

Up/Down/Left/Right Arrow

Focus the virtual terminal above/below/to the left of/to the right of the currently focused terminal.

o

Focus the previously-focused virtual terminal.

h / v

Split the focused virtual terminal in half horizontally/vertically, creating a new virtual terminal to the right/below. The new virtual terminal is focused.

w

Delete the focused virtual terminal. Some other nearby virtual terminal will become focused if there are any left. mtm will exit once all virtual terminals are closed. Virtual terminals will also close if the program started inside them exits.

l

Redraw the screen.

PgUp/PgDown/End

Scroll the screen back/forward half a screenful, or recenter the screen on the actual terminal.

That's it. There aren't dozens of commands, there are no modes, there's nothing else to learn.

(Note that these keybindings can be changed at compile time.)

Screenshots

mtm running three instances of tine

image

mtm running various other programs

image

mtm showing its compatibility

image

image

Compatibility

(Note that you only need to read this section if you're curious. mtm should just work out-of-the-box for you, thanks to the efforts of the various hackers over the years to make terminal-independence a reality.)

By default, mtm advertises itself as a screen-bce terminal. This is what GNU screen and tmux advertise themselves as, and is a well-known terminal type that has been in the default terminfo database for decades.

(Note that this should not be taken to imply that anyone involved in the GNU screen or tmux projects endorses or otherwise has anything to do with mtm, and vice-versa. Their work is excellent, though, and you should definitely check it out.)

The (optional!) mtm Terminal Types ------------------------mtm comes with a terminfo description file called mtm.ti. This file describes all of the features supported by mtm.

If you want to install this terminal type, use the tic compiler that comes with ncurses:

tic -s -x mtm.ti

or simply:

make install-terminfo

This will install the following terminal types:

mtm

This terminal type supports all of the features of mtm, but with the default 8 "ANSI" colors only.

mtm-256color

Note that mtm is not magic and cannot actually display more colors than the host terminal supports.

mtm-noutf

This terminal type supports everything the mtm terminal type does, but does not advertise UTF8 capability.

That command will compile and install the terminfo entry. After doing so, calling mtm with `-t mtm`:

mtm -t mtm

will instruct programs to use that terminfo entry. You can, of course, replace mtm with any of the other above terminal types.

Using these terminfo entries allows programs to use the full power of mtm's terminal emulation, but it is entirely optional. A primary design goal of mtm was for it to be completely usable on systems that didn't have the mtm terminfo entry installed. By default, mtm advertises itself as the widely-available screen-bce terminal type.

Copyright and License

Copyright 2016-2019 Rob King <[email protected]>

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.

mtm's People

Contributors

deadpixi avatar domrc avatar egzvor avatar fxleblanc avatar julien avatar melak avatar mspielberg avatar timgates42 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mtm's Issues

Doesn't work on st and urxvt

I'm on Arch Linux. I have installed mtm both from git and from AUR.

mtm seems to work fine in uxterm, but doesn't do anything in st/urxvt.

-> [ ~ ] :: mtm
-> [ ~ ] :: mtm
-> [ ~ ] :: mtm
-> [ ~ ] :: ls
 c_unix_and_algo
 media/
-> [ ~ ] ::

Fatal error when running make

I'm getting a fatal error: ncursesw/curses.h: No such file or directory when running make or make CURSESLIB=curses.

Do I have to provide this file? Im not familiar with ncurses or even it's sources.

I'm on a healthy, fullly updated Arch box, ncurses version 6.1-6 is installed.
I created said folder, copied /usr/include/curses.h into it but the error doesn't change a bit. Also happens with ncurses.h.

Am I getting something wrong, or is this a bug? I just wanted vim bindings!

Compiling in Alpine and Arch linux

Related to #41
Compiling in Alpine linux from the master branch results in the compiler not finding curses.h and not having the man directory /usr/local.

I made these changes in config.def.h:

diff --git a/config.def.h b/config.def.h
index 248b296..f6ed0fc 100644
--- a/config.def.h
+++ b/config.def.h
@@ -61,7 +61,7 @@
 
 /* The path for the wide-character curses library. */
 #ifndef NCURSESW_INCLUDE_H
-    #if defined(__APPLE__) || !defined(__linux__) || defined(__FreeBSD__)
+    #if defined(__APPLE__) || !defined(__linux__) || !defined(linux) || defined(__FreeBSD__)
         #define NCURSESW_INCLUDE_H <curses.h>
     #else
         #define NCURSESW_INCLUDE_H <ncursesw/curses.h>

Then compiled it this way:

MANDIR=/usr/share make && make install

That allowed it to compile on Alpine.

On Arch Linux I had to do the same line replacement in config.def.h, but I did not have to change the MANDIR argument.

Compilation error on Ubuntu 18.04

Compilation fails on Ubuntu 18.04. Looks like alloc_pair() is introduced in ncurses 6.1.

$ make
cc -std=c99 -Wall -Wextra -pedantic -Os -D_POSIX_C_SOURCE=200809L -D_XOPEN_SOURCE=600 -D_XOPEN_SOURCE_EXTENDED -o mtm  vtparser.c mtm.c  -lncursesw -lutil
mtm.c: In function ‘getinput’:
mtm.c:979:9: warning: ignoring return value of ‘read’, declared with attribute warn_unused_result [-Wunused-result]
         read(statusfd, statusmsg, MAXOSC);
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/cc4Dsw9O.o: In function `sgr':
mtm.c:(.text+0x19c5): undefined reference to `alloc_pair'
/tmp/cc4Dsw9O.o: In function `rc':
mtm.c:(.text+0x1b3e): undefined reference to `alloc_pair'
/tmp/cc4Dsw9O.o: In function `main':
mtm.c:(.text.startup+0x12e): undefined reference to `alloc_pair'
collect2: error: ld returned 1 exit status
Makefile:14: recipe for target 'mtm' failed
make: *** [mtm] Error 1

Error and warning when compiling on OSX 10.10

I just tried to compile mtm on OSX, and I received the following error:

mtm.c:339:32: error: use of undeclared identifier 'A_ITALIC'

and the following warning:

mtm.c:676:5: warning: implicit declaration of function 'ioctl' is invalid in C99 [-Wimplicit-function-declaration]

How would I go about solving this? :)

USAGE, README, and MAN docs list invalid command line flags.

The README has:

Usage is simple::

    mtm [-T NAME] [-t NAME] [-c KEY] [-b COLOR]

The `-T` flag tells mtm to assume a different kind of host terminal.

The `-t` flag tells mtm what terminal type to advertise itself as.
Note that this doesn't change how mtm interprets control sequences; it
simply controls what the `TERM` environment variable is set to.

The `-c` flag lets you specify a keyboard character to use as the "command
prefix" for mtm when modified with *control* (see below).  By default,
this is `g`.

The `-b` flag lets you specify the background color for the status bar.

The `-s` flag names a status file, and the `-S` flag indicates how often this
file should be checked. The contents of this file will be displayed in the
left side status bar, before any window title.

USAGE on the command line is defined as:

#define USAGE "usage: mtm [-s] [-T NAME] [-t NAME] [-c KEY]\n"

The man page lists:

-T HOST
-t TERMINAL
-c CHARACTER
-b COLOR
-s FILE

What's actually supported:

    int c = 0;
    while ((c = getopt(argc, argv, "c:T:t:x")) != -1) switch (c){
        case 'c': commandkey = CTL(optarg[0]);      break;
        case 'T': setenv("TERM", optarg, 1);        break;
        case 't': term = optarg;                    break;
        case 'x': dostatus = true;                  break;
        default:  quit(EXIT_FAILURE, USAGE);        break;
    }

Arrow Keys not working under Termion

Hi there, I don't think this is a bug in mtm, but I could use some guidance if possible!

When using mtm to run a program created using the termion library for Rust, arrow keypresses are not being detected.

I've done some digging and it looks like this is because (by default) mtm sends "application mode" cursor commands like \EOA instead of "normal mode" cursor commands such as \E[A. Is this right or am I misunderstanding?

This line in particular checks for pnm on a node and sends the O or [ prefix accordingly:

https://github.com/deadpixi/mtm/blob/36910ba0/mtm.c#L1037

static void
sendarrow(const NODE *n, const char *k)
{
    char buf[100] = {0};
    snprintf(buf, sizeof(buf) - 1, "\033%s%s", n->pnm? "O" : "[", k);
    SEND(n, buf);
}

However, it seems that Termion only looks for \E[A and friends when detecting arrow keys: https://gitlab.redox-os.org/redox-os/termion/-/blob/a448f510/src/event.rs#L154-157

You can verify this by cloning Termion and running the keys example both within and without mtm:

git clone https://github.com/redox-os/termion
cd termion
cargo run --example keys

In my terminal, without mtm, I can run the example and see arrow keypresses registered. Under mtm, most keys work but the arrow keys don't do anything.

All that said, here's my question:

As an application developer, should I be sending an escape code to say I want "normal mode"? aka should I be setting pnm = false somehow? Or should the Termion library be looking for \EOA and parsing it the same as \E[A?

If so I am happy to send a patch. I guess I'm trying to determine if I should fix this behavior in my app or in the Termion library.

Thank you!

Command key

Hi,

Could you please add an option to change the control key? I would like to use ALT+<ESC> as a control shortcut.

Thanks in advace.

Arcane bug when using with a session manager (ie. abduco/tmux)

Nested mtm with abduco can create a situation where x and q appear instead of unicode graphics.
Reproduction

  1. start two shells
  2. start mtm in both
  3. start abduco in one (and probably other session managers, I think the bug is in mtm)
  4. connect to it with the other one
  5. do a vertical and a horizontal split in the inner server mtm to see the results in the client

What is going on here?

Support for multiple windows

Would you consider to provide support for multiple (fullscreen) windows? It appears doable, creating, focusing and deleting newview() as needed. However, I wasn't able to do it myself...

Does mtm support detaching?

Does mtm support detaching? From the README it looks like the answer is "no". If not, would you consider a (hypothetical) program that supports only detaching to be a good complement to mtm?

UTF-8 characters in PS1 issue in st

Maybe you thing it is an abomination to have these, but I like them for tracking my git branch in the pwd. They get boxed.

Apparently st doesn't even work for some people. Problem is certainly with character encodings and colour management/font management. Maybe a recommended or custom patch for st is needed.

Debian Packaging

This program looks great. I hope to try it out this (or next) weekend on a Debian server.

It would be great for a package to be available in the Debian repository.

Thank you!

Add LICENSE file

Make a separate file for your license instead of putting it in the README. And copyright years need updating to 2016-2022

Thank you

h and v options are inverted

I'm using the Arch Linux AUR package, and as the title says the options are inverted.
h splits vertically, and v horizontally. I checked the PKGBUILD and didn't find any compile time changes that could cause this. So, is it a problem with mtm or asome weird package issue?

Scrolling

It would be nice to have a simple scrolling implementation in mtm.

Chunked output

Commands that produce ‘many’ lines and bytes of output (e.g., ps faux: 26+ kB in 200+ lines) seem to become displayed in chunks of approximately 4 kB bytes, temporally spaced ~1 second apart when run in an mtm pane, while the same output appears virtually instantly without mtm.

The textmode editor jed takes approximately 5 seconds to initialize its display in an mtm pane, all the while the cursor jumps to different positions appr. every second. The same initialization takes place instantly without mtm.

Displaying a 256 line ASCII file with 128 chars per line (including line terminator) in pagers more, less and most exhibits the same chunkiness in mtm.

The funny thing is, that while the above is also true while recording the session with asciinema (to illustrate what I see), replaying the recorded file does not show the chunked output when replayed outside of mtm.

All of this happens on a local machine, there is no network involved.

mtm: 1.0 and 1.0.1
OS: ArchLinux x86_64
glibc: 2.29
ncurses: 6.1
Window manager: qtile
Terminal emulator: sakura, lilyterm or xterm
Shell: fish or bash
$TERM: xterm-256color (before starting mtm, screen-256color inside mtm)
$LANG: en_DK.UTF-8
$LC_ALL: en_DK.UTF-8
$COLUMNS: 191
$LINES: 60

Conflicts with zsh

Thank you for the nice software. However, It looks like there is a bug with zsh:
a h (sometimes followed by a l) appears after the prompt.
I'd gladly help if given any hint where to look first.

Resize pane

Looks pretty clear that you don't intend to add any new feature, though I think a lot of times resizing a pane is needed, are you willing to build it or receive contributions regarding this?

Thanks for this software, indeed looks great :D

sharing screen

Is possible sharing sesion similar https://tmate.io/ or other way.
I would showing my friend nice console program and dont know how to do this

Segfaulting on OSX

I compiled mtm with CURSESLIB=curses and whenever I run it, it segfaults.

If I compile with debugging info and run it the following backtrace is what lldb shows me:

* thread #1: tid = 0xf377c7, 0x00007fff91ca748d libncurses.5.4.dylib`doupdate + 237, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x58)
  * frame #0: 0x00007fff91ca748d libncurses.5.4.dylib`doupdate + 237
    frame #1: 0x00007fff91c9b4d1 libncurses.5.4.dylib`wrefresh + 68
    frame #2: 0x0000000100001927 mtm`doripoff(w=0x0000000100201770, i=<unavailable>) + 39 at mtm.c:853 [opt]
    frame #3: 0x00007fff91c9cf49 libncurses.5.4.dylib`_nc_setupscreen + 1610
    frame #4: 0x00007fff91c995a6 libncurses.5.4.dylib`newterm + 191
    frame #5: 0x00007fff91c96581 libncurses.5.4.dylib`initscr + 83
    frame #6: 0x0000000100001b80 mtm`main(argc=<unavailable>, argv=<unavailable>) + 592 at mtm.c:894 [opt]
    frame #7: 0x00007fff8a5a75ad libdyld.dylib`start + 1
    frame #8: 0x00007fff8a5a75ad libdyld.dylib`start + 1

Don't know how useful this is? I just started learning C the other day, so I can't really imagine what you'd need :) If you need anything else, please tell me :)

Use .POSIX as first line in makefile

I noticed that a lot of issues/pulls are related to the makefile portability. The .POSIX: line tells make to follow the posix standard and is recommended.

Here is the POSIX standard for make: https://pubs.opengroup.org/onlinepubs/9699919799/utilities/make.html

And a quote:

To receive exactly the behavior described in this section, the user shall ensure that a portable makefile shall:

    Include the special target .POSIX

    Omit any special target reserved for implementations (a leading period followed by uppercase letters) that has not been specified by this section

The behavior of make is unspecified if either or both of these conditions are not met.

To do it you put only .POSIX: on the first line of the make file.

Put compiled code into "releases"

Not to waste time on installation people can download already compiled binaries, like this:

curl -L https://githubusercontent.com/...

Please publish releases ❤️ in this tab.

mtm is not showing 256 colors and not even 16 color

From the screenshots in the Readme, I understand there should be some color support.

Currently using xfce4-terminal, I ran this script.

for i in {0..15} ; do                                                                  ~
    printf "\x1b[48;5;%sm%3d\e[0m " "$i" "$i"
    if (( i == 15 )) || (( i > 15 )) && (( (i-15) % 6 == 0 )); then
        printf "\n";
    fi
done

Left is output outside mtm, and right is inside mtm. $TERM inside mtm is eterm-color. After installing mtm terminfo, wwitching to mtm -t mtm doesn't make any difference.

mtm

If I try to show 256 colors, most numbers are shown as blinking text.

Cursor flickers between virtual terminals while typing

After splitting into two side by side virtual terminals, typing in the focused one intermittently causes the cursor to flicker in the non-focused one. I'm running with OSX Terminal.app SSHing into a VirtualBox running Arch Linux. I can reproduce consistently by pressing enter at the command line and then holding down the backspace key.

Question on 24bit color support

Upon research neovim uses setrgbf and setrgbb terminfo extensions for termguicolors and termguicursors. Even if I install these locally is it fundamentally unsupported by mtm - I understand and agree if this is a choice for compatibility.

Any info would be very helpful, as in the end I may just fork to support those extensions, thanks in advance :>

Strange behavior with Vim over SSH when using mtm in TTY

In a horizontally-split mtm session in the Linux TTY, when I SSH into a remote server and edit a file with Vim, some actions (such as deleting lines, undoing deleting lines, and toggling syntax highlighting) cause the display to be incorrect (wrong lines being shown to be deleted, deleted text not being erased, overlapping text, etc).

These are all problems with the display; the content of the Vim buffer would still be correct, though it is displayed incorrectly. Forcing Vim to redraw itself (opening a new tab (:tabe) and closing it) would usually fix the display.

This did not occur when I tested this:

  • In an X session (rather than a TTY) with a terminal emulator (st)
  • With the same file on the local machine (i.e. not using SSH)

I unable to consistently reproduce this and unsure how to debug this, but is there anyone who has experienced similar problems, or more knowledge about terminals who knows a possible cause of this?

My local computer is Arch Linux and the remote server is Debian 11 (bullseye).

Build fails on OpenBSD-current

fremen:mtm> make
cc -O2 -pipe  -D_POSIX_C_SOURCE=200809L -D_XOPEN_SOURCE=600 -D_XOPEN_SOURCE_EXTENDED -o mtm  vtparser.c mtm.c  -lncursesw -lutil
In file included from mtm.c:40:
./config.h:81:10: fatal error: 'pty.h' file not found
#include FORKPTY_INCLUDE_H
         ^~~~~~~~~~~~~~~~~
./config.h:78:35: note: expanded from macro 'FORKPTY_INCLUDE_H'
        #define FORKPTY_INCLUDE_H <pty.h>
                                  ^~~~~~~
1 error generated.

I didn't investigate further, sorry :)

eterm issue

mtm compiles on elementary os 0.4 "Loki", but then throws up an error on execution. To fix this I changed line 85 in mtm.C from

static` const char *term = "eterm-color";

to

static const char *term = "Eterm-color";

works fine now.

key presses not detected non x86 architecture

I don't have a whole lot of information on this yet. I've built mtm as a part of the Openwrt/LEDE build system, and loaded it on an MIPS router and an x86 VM.

Mtm seems to work flawlessly on the x86 VM. On the router, it starts without issue, and the ctrl + g commands work as expected. The enter key is handled correctly as well. No other key strokes are detected.

The router is an ar71xx architecture, and is big-endian -- the opposite of x86. Is it possible that mtm isn't endian safe?

I won't have much time to dig in and try to troubleshot this myself, but I'll do what I can.

Unable to close a virtual terminal (probably due to misconfigured termcap) on FreeBSD

I cannot close a virtual terminal inside mtm. I guess it might be related to the terminal type and the termcap database. I've tried to run

# tic -C -K -s -x mtm.ti >> /usr/share/misc/termcap
# cd /usr/share/misc
# cap_mkdb termcap

but it didn't help.

Launching mtm with -t mtm, -t xterm does not help.

I'm running FreeBSD 12.0-CURRENT r333344 amd64.


Related: #22

Homebrew formula

Hi @deadpixi 👋

I've tried to package mtm for Homebrew distribution but a substantial amount of changes between the latest release and HEAD turned out to be a dealbreaker (Homebrew/homebrew-core#66093 (comment))
I'm wondering is there a new release on the horizon anytime soon so we could move this thing forward?

Fixing build on (Free)BSD

I'm fixing building on FreeBSD, and there's a thing in config.h.def I'm not sure about.

    49  /* Includes needed to make forkpty(3) work. */
    50  #ifndef FORKPTY_INCLUDE_H
    51      #if defined(__APPLE__) || (defined(BSD) && !defined(__linux__))
    52          #define FORKPTY_INCLUDE_H <util.h>

What is the BSD macro for? FreeBSD definitely does not define it, OSX does not define it, Linux obviously doesn't, I'm pretty sure neither do Open/Net/Dfly (although I'm not sure about these).

The forkpty include is slightly different across the BSDs, so this will have to be a bit more granular than just "if BSD" - at this point though, I'm not sure if it's just a placeholder of sorts, or if there's an actual use case for it I can't seem to find.

Doesn't transmite mouse event

Hello,

I running the kakoune text editor inside mtm. Kakoune works with mouse event like mouse like and mouse drag, but not inside mtm.

Delay when switching modes in vi

There's a very noticable delay when switching modes in vi

This problem exists is screen (AFAIK in tmux too), which has an option to change the escape delay: maptimeout 0

From the screen manpage:

maptimeout [timeout]
Set the inter-character timer for input sequence detection to a timeout of timeout ms. The
default timeout is 300ms. Map‐
timeout with no arguments shows the current setting. See also "bindkey".

A quick grep through the screen source suggested that it is calling a SetTimeout function (sorry i'm not familiar enough with c to figure out any more than this)

Is there a similar option for mtm? Initial impression are really good, but i can't use it if it breaks vi :(

Missing pty.h on macOS

It could be a mistake on my part, but I'm encountering this error.

$ make
cp -i config.def.h config.h
gcc -O3 -std=c99 -Wall -Wno-unused-variable -D_POSIX_C_SOURCE=200809L -D_XOPEN_SOURCE_EXTENDED -DTMT_HAS_WCWIDTH -o mtm -DNCURSESW_INCLUDE_H="<ncursesw/curses.h>" tmt.c mtm.c  -lncursesw -lutil
mtm.c:19:10: fatal error: 'pty.h' file not found
#include <pty.h>
         ^
1 error generated.
make: *** [mtm] Error 1
$ 

OS and distribution dependent makefile

Manjaro and Arch do use #define NCURSESW_INCLUDE_H <curses.h>,
but __Linux__ only provides here <ncursesw/curses.h>.

The general way to detect the Linux in the shell is this.
However for Windows to work we need this.

Any idea to make this easier ?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.