Full Code of mobile-shell/mosh for AI

master b5775df441bb cached
215 files
886.5 KB
252.3k tokens
308 symbols
1 requests
Download .txt
Showing preview only (942K chars total). Download the full file or copy to clipboard to get everything.
Repository: mobile-shell/mosh
Branch: master
Commit: b5775df441bb
Files: 215
Total size: 886.5 KB

Directory structure:
gitextract_40azl391/

├── .clang-format
├── .gitattributes
├── .github/
│   └── workflows/
│       ├── ci.yml
│       ├── cifuzz.yml
│       ├── clang-format.yml
│       └── release.yml
├── .gitignore
├── AUTHORS
├── COPYING
├── COPYING.iOS
├── ChangeLog
├── Makefile.am
├── NEWS
├── README.md
├── THANKS
├── autogen.sh
├── build-package.sh
├── build-source-package.sh
├── conf/
│   ├── Makefile.am
│   ├── bash-completion/
│   │   └── completions/
│   │       └── mosh
│   └── ufw/
│       └── applications.d/
│           └── mosh
├── configure.ac
├── debian/
│   ├── changelog
│   ├── control
│   ├── copyright
│   ├── docs
│   ├── mosh.maintscript
│   ├── rules
│   ├── source/
│   │   └── format
│   └── watch
├── fedora/
│   └── mosh.spec
├── m4/
│   ├── ax_ac_append_to_file.m4
│   ├── ax_ac_print_to_file.m4
│   ├── ax_add_am_macro_static.m4
│   ├── ax_am_macros_static.m4
│   ├── ax_check_compile_flag.m4
│   ├── ax_check_gnu_make.m4
│   ├── ax_check_library.m4
│   ├── ax_check_link_flag.m4
│   ├── ax_code_coverage.m4
│   ├── ax_cxx_compile_stdcxx.m4
│   ├── ax_file_escapes.m4
│   ├── ax_require_defined.m4
│   ├── ax_with_curses.m4
│   └── pkg.m4
├── macosx/
│   ├── .gitignore
│   ├── Distribution.in
│   ├── brew-deps.sh
│   ├── build.sh
│   ├── copying.rtf
│   ├── gtar
│   ├── mosh-package.pmdoc.in/
│   │   ├── 01prefix-contents.xml
│   │   ├── 01prefix.xml
│   │   └── index.xml
│   ├── osx-xcode.sh
│   ├── port-deps.sh
│   └── readme.rtf
├── man/
│   ├── Makefile.am
│   ├── mosh-client.1
│   ├── mosh-server.1
│   └── mosh.1
├── ocb-license.html
├── scripts/
│   ├── Makefile.am
│   ├── mosh.pl
│   └── wrap-compiler-for-flag-check
└── src/
    ├── Makefile.am
    ├── crypto/
    │   ├── Makefile.am
    │   ├── ae.h
    │   ├── base64.cc
    │   ├── base64.h
    │   ├── byteorder.h
    │   ├── crypto.cc
    │   ├── crypto.h
    │   ├── ocb_internal.cc
    │   ├── ocb_openssl.cc
    │   └── prng.h
    ├── examples/
    │   ├── .gitignore
    │   ├── Makefile.am
    │   ├── benchmark.cc
    │   ├── decrypt.cc
    │   ├── encrypt.cc
    │   ├── ntester.cc
    │   ├── parse.cc
    │   └── termemu.cc
    ├── frontend/
    │   ├── .gitignore
    │   ├── Makefile.am
    │   ├── mosh-client.cc
    │   ├── mosh-server.cc
    │   ├── stmclient.cc
    │   ├── stmclient.h
    │   ├── terminaloverlay.cc
    │   └── terminaloverlay.h
    ├── fuzz/
    │   ├── Makefile.am
    │   ├── terminal_corpus/
    │   │   ├── 3769c52698d426976ee402b9dbc3c2a7bd5e5485
    │   │   ├── 3a52ce780950d4d969792a2559cd519d7ee8c727
    │   │   ├── 3facad9d449f8b10a2d18ef821325639214afc3c
    │   │   ├── 433f367f36f48f78570c2013fef7a4f4b52b7c0c
    │   │   ├── 5ba93c9db0cff93f52b521d7420e43f6eda2784f
    │   │   ├── 64b6cc492319c39d017963ee8f5863520eb7b6b9
    │   │   ├── 7c4d33785daa5c2370201ffa236b427aa37c9996
    │   │   ├── 7fff5c5bdfcaecbe749a7eda1f831a4b0ac6c285
    │   │   ├── 94fc46a4dd7043c8a22bc85f24aafdf0bc963125
    │   │   ├── 9a78211436f6d425ec38f5c4e02270801f3524f8
    │   │   ├── a70a7fcfa8e88039504b6a798314285419f51e16
    │   │   ├── adc83b19e793491b1c6ea0fd8b46cd9f32e592fc
    │   │   ├── bf72240ede73688a77e62c38b4a112f15cb61802
    │   │   ├── c822a8bc8c7d9f938990c2bfd0b24fd9d48af917
    │   │   ├── e0d3c08cb28736844512c52dc05fa4e4efd91490
    │   │   └── f195c020a28dfc5f2fb6af256b524ddcd93756ed
    │   ├── terminal_fuzzer.cc
    │   ├── terminal_parser_corpus/
    │   │   ├── 7164cb6ab7e834fa6145bcf283e94b981313980d
    │   │   ├── 71853c6197a6a7f222db0f1978c7cb232b87c5ee
    │   │   ├── 7b98b1bb85d1afb4f154cfbe9c3d4791024a86b7
    │   │   ├── 8a92b4d6e188b3e2fa7add9e123b702ed11f3695
    │   │   ├── 99feeb7f36e52ff59d86c975a8e5ad1a2ab4629e
    │   │   ├── 9d5e4e241c99c93786eeddcd93c5ec23dd563881
    │   │   ├── 9e016e2a52e879c9c6482303eea8eb7d92b4dd38
    │   │   ├── a09fd95888cb80e1dcea4cc9dbd7d76928909927
    │   │   ├── abb6d63b8f739c45c3c44f1772b88338e9b5e7a3
    │   │   ├── adc83b19e793491b1c6ea0fd8b46cd9f32e592fc
    │   │   └── b67f23988e8274fcf6150a18dacb5ab3db49520d
    │   └── terminal_parser_fuzzer.cc
    ├── include/
    │   └── Makefile.am
    ├── network/
    │   ├── Makefile.am
    │   ├── compressor.cc
    │   ├── compressor.h
    │   ├── network.cc
    │   ├── network.h
    │   ├── networktransport-impl.h
    │   ├── networktransport.h
    │   ├── transportfragment.cc
    │   ├── transportfragment.h
    │   ├── transportsender-impl.h
    │   ├── transportsender.h
    │   └── transportstate.h
    ├── protobufs/
    │   ├── Makefile.am
    │   ├── hostinput.proto
    │   ├── transportinstruction.proto
    │   └── userinput.proto
    ├── statesync/
    │   ├── Makefile.am
    │   ├── completeterminal.cc
    │   ├── completeterminal.h
    │   ├── user.cc
    │   └── user.h
    ├── terminal/
    │   ├── Makefile.am
    │   ├── parser.cc
    │   ├── parser.h
    │   ├── parseraction.cc
    │   ├── parseraction.h
    │   ├── parserstate.cc
    │   ├── parserstate.h
    │   ├── parserstatefamily.h
    │   ├── parsertransition.h
    │   ├── terminal.cc
    │   ├── terminal.h
    │   ├── terminaldispatcher.cc
    │   ├── terminaldispatcher.h
    │   ├── terminaldisplay.cc
    │   ├── terminaldisplay.h
    │   ├── terminaldisplayinit.cc
    │   ├── terminalframebuffer.cc
    │   ├── terminalframebuffer.h
    │   ├── terminalfunctions.cc
    │   ├── terminaluserinput.cc
    │   └── terminaluserinput.h
    ├── tests/
    │   ├── .gitignore
    │   ├── Makefile.am
    │   ├── README.md
    │   ├── base64.cc
    │   ├── base64_vector.h
    │   ├── e2e-failure.test
    │   ├── e2e-success.test
    │   ├── e2e-test
    │   ├── e2e-test-server
    │   ├── e2e-test-subrs
    │   ├── emulation-80th-column.test
    │   ├── emulation-ascii-iso-8859.test
    │   ├── emulation-attributes.test
    │   ├── emulation-back-tab.test
    │   ├── emulation-cursor-motion.test
    │   ├── emulation-multiline-scroll.test
    │   ├── emulation-scroll.test
    │   ├── emulation-wrap-across-frames.test
    │   ├── encrypt-decrypt.cc
    │   ├── genbase64.pl
    │   ├── hold-stdin
    │   ├── inpty.cc
    │   ├── is-utf8-locale.cc
    │   ├── local.test
    │   ├── network-no-diff.test
    │   ├── nonce-incr.cc
    │   ├── ocb-aes.cc
    │   ├── prediction-unicode.test
    │   ├── print-exitstatus
    │   ├── pty-deadlock.test
    │   ├── repeat.test
    │   ├── server-network-timeout.test
    │   ├── test_utils.cc
    │   ├── test_utils.h
    │   ├── unicode-combine-fallback-assert.test
    │   ├── unicode-later-combining.test
    │   └── window-resize.test
    └── util/
        ├── Makefile.am
        ├── dos_assert.h
        ├── fatal_assert.h
        ├── locale_utils.cc
        ├── locale_utils.h
        ├── pty_compat.cc
        ├── pty_compat.h
        ├── select.cc
        ├── select.h
        ├── swrite.cc
        ├── swrite.h
        ├── timestamp.cc
        └── timestamp.h

================================================
FILE CONTENTS
================================================

================================================
FILE: .clang-format
================================================
---
Language: Cpp
BasedOnStyle: Mozilla
ColumnLimit: 116
SpacesInParentheses: true
AlwaysBreakAfterReturnType: None
AlwaysBreakAfterDefinitionReturnType: None
SpaceBeforeCpp11BracedList: true
BreakBeforeBinaryOperators: All
Cpp11BracedListStyle: true
AllowShortBlocksOnASingleLine: Always
BreakBeforeBraces: Custom
BraceWrapping:
  AfterClass: true
  AfterControlStatement: Never
  AfterFunction: true
  AfterStruct: true
  AfterEnum: true
  SplitEmptyFunction: false
  SplitEmptyRecord: false
  SplitEmptyNamespace: false
BreakConstructorInitializers: BeforeColon
...


================================================
FILE: .gitattributes
================================================
* text=true


================================================
FILE: .github/workflows/ci.yml
================================================
name: ci

on: [push, pull_request]

jobs:
  build:
    runs-on: ${{ matrix.os }}

    strategy:
      matrix:
        os: [macos-latest, ubuntu-22.04, ubuntu-24.04]
        crypto: [auto]
        include:
          - crypto: nettle
            os: ubuntu-22.04
        

    steps:
    - uses: actions/checkout@v2

    - name: "setup linux build environment"
      if: ${{ startsWith(matrix.os, 'ubuntu') }}
      run: sudo apt update && sudo apt install -y protobuf-compiler libprotobuf-dev libutempter-dev autoconf automake nettle-dev

    - name: "setup macos build environment"
      if: ${{ startsWith(matrix.os, 'macos') }}
      run: brew install protobuf automake

    - name: "generate build scripts"
      run: ./autogen.sh

    - name: ${{ format('configure (crypto {0})', matrix.crypto) }}
      run: ./configure --enable-compile-warnings=error --enable-examples ${{ (matrix.crypto != 'auto' && format('--with-crypto-library={0}', matrix.crypto)) || '' }}

    - name: "build"
      run: make V=1

    - name: "test"
      run: make V=1 check


================================================
FILE: .github/workflows/cifuzz.yml
================================================
name: CIFuzz
on: [pull_request]
jobs:
  Fuzzing:
    runs-on: ubuntu-latest
    steps:
    - name: Build Fuzzers
      id: build
      uses: google/oss-fuzz/infra/cifuzz/actions/build_fuzzers@master
      with:
        oss-fuzz-project-name: 'mosh'
        dry-run: false
        language: c++
    - name: Run Fuzzers
      uses: google/oss-fuzz/infra/cifuzz/actions/run_fuzzers@master
      with:
        oss-fuzz-project-name: 'mosh'
        fuzz-seconds: 300
        dry-run: false
        language: c++
    - name: Upload Crash
      uses: actions/upload-artifact@v4
      if: failure() && steps.build.outcome == 'success'
      with:
        name: artifacts
        path: ./out/artifacts


================================================
FILE: .github/workflows/clang-format.yml
================================================
name: clang-format-lint

on: [pull_request]

jobs:
  build:
    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v2
    - uses: DoozyX/clang-format-lint-action@v0.16.2
      with:
        source: './src'
        style: file
        clangFormatVersion: 14


================================================
FILE: .github/workflows/release.yml
================================================
name: Release

on:
  push:
    tags:
      # This syntax is globs, not regex, so it's matching any tag that
      # contains the prefix "mosh-" and the 3 version elements.
      - "mosh-*.*.*"

jobs:
  macports-cache:
    runs-on: macos-12

    steps:
    - uses: actions/checkout@v2

    - name: "Install gtar wrapper"
      run: |
        sudo mv /usr/local/bin/gtar /usr/local/bin/gtar.orig
        sudo cp macosx/gtar /usr/local/bin/gtar
        sudo chmod +x /usr/local/bin/gtar

    - name: Cache macports
      id: cache-macports
      uses: actions/cache@v3
      env:
        cache-name: cache-macports
      with:
        path: /opt/local
        key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('macosx/port-deps.sh') }}
        restore-keys: |
          ${{ runner.os }}-build-${{ env.cache-name }}-
          ${{ runner.os }}-build-
          ${{ runner.os }}-

    - name: "setup MacPorts environment"
      run: |
        curl -L "https://github.com/macports/macports-base/releases/download/v2.7.2/MacPorts-2.7.2-12-Monterey.pkg" --output macports.pkg
        sudo installer -pkg macports.pkg -target /
        ./macosx/port-deps.sh deps

  release:
    needs: macports-cache
    runs-on: ${{ matrix.os }}

    strategy:
      matrix:
        os: [ubuntu-22.04, macos-12]

    steps:
    - uses: actions/checkout@v2

    - name: "ensure version bumped"
      run: |
        expected_tag=$(echo ${{ github.ref }} | cut -d'/' -f3)
        have_tag="mosh-$(sed -n 's/AC_INIT(\[[^]]*\], \[\([^]]*\)\].*/\1/p' <configure.ac)"
        echo "Expected tag <$expected_tag>, got <$have_tag>"
        if [[ "$expected_tag" != "$have_tag" ]]; then exit 1; fi

    - name: "setup linux build environment"
      if: ${{ startsWith(matrix.os, 'ubuntu') }}
      run: sudo apt update && sudo apt install -y protobuf-compiler libprotobuf-dev libutempter-dev autoconf automake nettle-dev

    - name: "Install gtar wrapper"
      if: ${{ startsWith(matrix.os, 'macos') }}
      run: |
        sudo mv /usr/local/bin/gtar /usr/local/bin/gtar.orig
        sudo cp macosx/gtar /usr/local/bin/gtar
        sudo chmod +x /usr/local/bin/gtar

    - name: Restore macports cache
      id: cache-macports
      if: ${{ startsWith(matrix.os, 'macos') }}
      uses: actions/cache@v3
      env:
        cache-name: cache-macports
      with:
        path: /opt/local
        key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('macosx/port-deps.sh') }}
        restore-keys: |
          ${{ runner.os }}-build-${{ env.cache-name }}-
          ${{ runner.os }}-build-
          ${{ runner.os }}-

    - name: "describe macos build environment"
      if: ${{ startsWith(matrix.os, 'macos') }}
      run: |
        BUILD_TAG=$(echo ${{ github.ref }} | cut -d'/' -f3)
        mkdir macosx/build-report &&
        pushd macosx/build-report &&
        ../port-deps.sh describe &&
        ../osx-xcode.sh describe &&
        tar -cjf "../${BUILD_TAG}-osx-build-report.tbz" . &&
        popd

    - name: "generate build scripts"
      run: PATH=/opt/local/bin:$PATH ./autogen.sh

    - name: "configure"
      if: ${{ startsWith(matrix.os, 'ubuntu') }}
      run: ./configure --enable-compile-warnings=error --enable-examples

    - name: "build"
      if: ${{ startsWith(matrix.os, 'ubuntu') }}
      run: make V=1

    - name: "test"
      if: ${{ startsWith(matrix.os, 'ubuntu') }}
      run: make V=1 distcheck -j

    - name: "unshallow git repository for git describe"
      if: ${{ startsWith(matrix.os, 'macos') }}
      run: git fetch --tags --unshallow -f

    - name: "macOS package build"
      if: ${{ startsWith(matrix.os, 'macos') }}
      run: |
        pushd macosx &&
        env ZERO_AR_DATE=1 MACOSX_DEPLOYMENT_TARGET=11.0 PATH=/opt/local/bin:$PATH ./build.sh &&
        popd

    - name: "Upload Release"
      # v1 aka v0.1.14 as of 2022-07-05; pinned to avoid potential code injection
      uses: softprops/action-gh-release@1e07f4398721186383de40550babbdf2b84acfc5
      with:
        # Action always creates releases in "draft" mode, and requires
        # a maintainer to publish them
        draft: True
        prerelease: ${{ contains(github.ref, 'rc') }}
        generate_release_notes: True
        files: |
          mosh-*.tar.gz
          macosx/*.pkg
          macosx/*-osx-build-report.tbz


================================================
FILE: .gitignore
================================================
*.a
*.o
*.pb.cc
*.pb.h
*~
.deps
Makefile
Makefile.in
.cproject
.project
compile_commands.json
aminclude_static.am

# Coverage artifacts
*.gcda
*.gcno
*-coverage.info
*-coverage

/INSTALL
/aclocal.m4
/ar-lib
/autom4te.cache
/compile
src/include/config.h
src/include/config.h.in
src/include/config.h.in~
/config.cache
/config.log
/config.status
/configure
/depcomp
/install-sh
/missing
/mosh-*.tar.gz
src/include/stamp-h1
/test-driver
/VERSION
/VERSION.stamp
/scripts/mosh
src/include/version.h


================================================
FILE: AUTHORS
================================================
Keith Winstein <mosh-devel@mit.edu>
Anders Kaseorg
Quentin Smith
Richard Tibbetts
Keegan McAllister
John Hood


================================================
FILE: COPYING
================================================
                    GNU GENERAL PUBLIC LICENSE
                       Version 3, 29 June 2007

 Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
 Everyone is permitted to copy and distribute verbatim copies
 of this license document, but changing it is not allowed.

                            Preamble

  The GNU General Public License is a free, copyleft license for
software and other kinds of works.

  The licenses for most software and other practical works are designed
to take away your freedom to share and change the works.  By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users.  We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors.  You can apply it to
your programs, too.

  When we speak of free software, we are referring to freedom, not
price.  Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.

  To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights.  Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.

  For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received.  You must make sure that they, too, receive
or can get the source code.  And you must show them these terms so they
know their rights.

  Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.

  For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software.  For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.

  Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so.  This is fundamentally incompatible with the aim of
protecting users' freedom to change the software.  The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable.  Therefore, we
have designed this version of the GPL to prohibit the practice for those
products.  If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.

  Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary.  To prevent this, the GPL assures that
patents cannot be used to render the program non-free.

  The precise terms and conditions for copying, distribution and
modification follow.

                       TERMS AND CONDITIONS

  0. Definitions.

  "This License" refers to version 3 of the GNU General Public License.

  "Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.

  "The Program" refers to any copyrightable work licensed under this
License.  Each licensee is addressed as "you".  "Licensees" and
"recipients" may be individuals or organizations.

  To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy.  The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.

  A "covered work" means either the unmodified Program or a work based
on the Program.

  To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy.  Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.

  To "convey" a work means any kind of propagation that enables other
parties to make or receive copies.  Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.

  An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License.  If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.

  1. Source Code.

  The "source code" for a work means the preferred form of the work
for making modifications to it.  "Object code" means any non-source
form of a work.

  A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.

  The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form.  A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.

  The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities.  However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work.  For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.

  The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.

  The Corresponding Source for a work in source code form is that
same work.

  2. Basic Permissions.

  All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met.  This License explicitly affirms your unlimited
permission to run the unmodified Program.  The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work.  This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.

  You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force.  You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright.  Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.

  Conveying under any other circumstances is permitted solely under
the conditions stated below.  Sublicensing is not allowed; section 10
makes it unnecessary.

  3. Protecting Users' Legal Rights From Anti-Circumvention Law.

  No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.

  When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.

  4. Conveying Verbatim Copies.

  You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.

  You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.

  5. Conveying Modified Source Versions.

  You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:

    a) The work must carry prominent notices stating that you modified
    it, and giving a relevant date.

    b) The work must carry prominent notices stating that it is
    released under this License and any conditions added under section
    7.  This requirement modifies the requirement in section 4 to
    "keep intact all notices".

    c) You must license the entire work, as a whole, under this
    License to anyone who comes into possession of a copy.  This
    License will therefore apply, along with any applicable section 7
    additional terms, to the whole of the work, and all its parts,
    regardless of how they are packaged.  This License gives no
    permission to license the work in any other way, but it does not
    invalidate such permission if you have separately received it.

    d) If the work has interactive user interfaces, each must display
    Appropriate Legal Notices; however, if the Program has interactive
    interfaces that do not display Appropriate Legal Notices, your
    work need not make them do so.

  A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit.  Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.

  6. Conveying Non-Source Forms.

  You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:

    a) Convey the object code in, or embodied in, a physical product
    (including a physical distribution medium), accompanied by the
    Corresponding Source fixed on a durable physical medium
    customarily used for software interchange.

    b) Convey the object code in, or embodied in, a physical product
    (including a physical distribution medium), accompanied by a
    written offer, valid for at least three years and valid for as
    long as you offer spare parts or customer support for that product
    model, to give anyone who possesses the object code either (1) a
    copy of the Corresponding Source for all the software in the
    product that is covered by this License, on a durable physical
    medium customarily used for software interchange, for a price no
    more than your reasonable cost of physically performing this
    conveying of source, or (2) access to copy the
    Corresponding Source from a network server at no charge.

    c) Convey individual copies of the object code with a copy of the
    written offer to provide the Corresponding Source.  This
    alternative is allowed only occasionally and noncommercially, and
    only if you received the object code with such an offer, in accord
    with subsection 6b.

    d) Convey the object code by offering access from a designated
    place (gratis or for a charge), and offer equivalent access to the
    Corresponding Source in the same way through the same place at no
    further charge.  You need not require recipients to copy the
    Corresponding Source along with the object code.  If the place to
    copy the object code is a network server, the Corresponding Source
    may be on a different server (operated by you or a third party)
    that supports equivalent copying facilities, provided you maintain
    clear directions next to the object code saying where to find the
    Corresponding Source.  Regardless of what server hosts the
    Corresponding Source, you remain obligated to ensure that it is
    available for as long as needed to satisfy these requirements.

    e) Convey the object code using peer-to-peer transmission, provided
    you inform other peers where the object code and Corresponding
    Source of the work are being offered to the general public at no
    charge under subsection 6d.

  A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.

  A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling.  In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage.  For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product.  A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.

  "Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source.  The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.

  If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information.  But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).

  The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed.  Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.

  Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.

  7. Additional Terms.

  "Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law.  If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.

  When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it.  (Additional permissions may be written to require their own
removal in certain cases when you modify the work.)  You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.

  Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:

    a) Disclaiming warranty or limiting liability differently from the
    terms of sections 15 and 16 of this License; or

    b) Requiring preservation of specified reasonable legal notices or
    author attributions in that material or in the Appropriate Legal
    Notices displayed by works containing it; or

    c) Prohibiting misrepresentation of the origin of that material, or
    requiring that modified versions of such material be marked in
    reasonable ways as different from the original version; or

    d) Limiting the use for publicity purposes of names of licensors or
    authors of the material; or

    e) Declining to grant rights under trademark law for use of some
    trade names, trademarks, or service marks; or

    f) Requiring indemnification of licensors and authors of that
    material by anyone who conveys the material (or modified versions of
    it) with contractual assumptions of liability to the recipient, for
    any liability that these contractual assumptions directly impose on
    those licensors and authors.

  All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10.  If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term.  If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.

  If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.

  Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.

  8. Termination.

  You may not propagate or modify a covered work except as expressly
provided under this License.  Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).

  However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.

  Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.

  Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License.  If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.

  9. Acceptance Not Required for Having Copies.

  You are not required to accept this License in order to receive or
run a copy of the Program.  Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance.  However,
nothing other than this License grants you permission to propagate or
modify any covered work.  These actions infringe copyright if you do
not accept this License.  Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.

  10. Automatic Licensing of Downstream Recipients.

  Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License.  You are not responsible
for enforcing compliance by third parties with this License.

  An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations.  If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.

  You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License.  For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.

  11. Patents.

  A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based.  The
work thus licensed is called the contributor's "contributor version".

  A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version.  For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.

  Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.

  In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement).  To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.

  If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients.  "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.

  If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.

  A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License.  You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.

  Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.

  12. No Surrender of Others' Freedom.

  If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License.  If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all.  For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.

  13. Use with the GNU Affero General Public License.

  Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work.  The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.

  14. Revised Versions of this License.

  The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time.  Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.

  Each version is given a distinguishing version number.  If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation.  If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.

  If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.

  Later license versions may give you additional or different
permissions.  However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.

  15. Disclaimer of Warranty.

  THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU.  SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.

  16. Limitation of Liability.

  IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.

  17. Interpretation of Sections 15 and 16.

  If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.

                     END OF TERMS AND CONDITIONS

            How to Apply These Terms to Your New Programs

  If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.

  To do so, attach the following notices to the program.  It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.

    <one line to give the program's name and a brief idea of what it does.>
    Copyright (C) <year>  <name of author>

    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/>.

Also add information on how to contact you by electronic and paper mail.

  If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:

    <program>  Copyright (C) <year>  <name of author>
    This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
    This is free software, and you are welcome to redistribute it
    under certain conditions; type `show c' for details.

The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License.  Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".

  You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<http://www.gnu.org/licenses/>.

  The GNU General Public License does not permit incorporating your program
into proprietary programs.  If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library.  If this is what you want to do, use the GNU Lesser General
Public License instead of this License.  But first, please read
<http://www.gnu.org/philosophy/why-not-lgpl.html>.


================================================
FILE: COPYING.iOS
================================================
The Mosh developers are aware that the terms of service that apply to
apps distributed via Apple's App Store services may conflict with
rights granted under Mosh's license, the GNU General Public License,
version 3. The Mosh copyright holders do not wish this conflict to
prevent the otherwise-compliant distribution of Mosh-derived apps via
the App Store. Therefore, we have committed not to pursue any license
violation that results solely from the conflict between the GPLv3 and
the Apple App Store terms of service. In other words, as long as you
comply with the GPL in all other respects, including its requirements
to provide users with source code and the text of the license, we will
not object to your distribution of Mosh through the App Store.


================================================
FILE: ChangeLog
================================================
2017-07-21 Keith Winstein <mosh-devel@mit.edu>

	* Version 1.3.2 released.

	* Platform support:
		* Explicitly enable binding to both IPv4 and IPv6 addresses.
		  (Giel van Schijndel)
		* Restore perl 5.8.8 support for RHEL5.  (Alexander Chernyakhovsky)
		* Make tests detect UTF-8 locale with a helper executable.  (John Hood)
		* Don't print /etc/motd on IllumOS.  (John Hood)
		* Print {,/var}/run/motd.dynamic on Ubuntu.  (John Hood)
		* Fix build on Haiku. (Adrien Destugues)
		* Disable unicode-later-combining.test for tmux 2.4.
		  This fixes build failures.  (John Hood)

	* Bug fixes:
		* In tests, explicitly set 80x24 tmux window, for newer versions
		  of tmux.  (John Hood)
		* Work around JuiceSSH rendering bug.  (John Hood)
		* Do not move cursor for SCROLL UP and SCROLL DOWN--
		  fixes an issue with tmux 2.4.  (John Hood)

2017-03-25 Keith Winstein <mosh-devel@mit.edu>

	* Version 1.3.0 released.

	* New features:
		* Change website URLs from http://mosh.mit.edu to
		  https://mosh.org.  (Keith Winstein)
		* Add --no-ssh-pty option for Dropbear compatibility and
		  other issues.
		* Switch to semantic versioning, making this version 1.3.0
		  instead of 1.2.7.

	* Platform support:
		* Added nonce-incrementing test.  (Keith Winstein)
		* Add build-source-package.sh for Debian.  (Keith Winstein)
		* Fix CPPFLAGS handling possibly causing curses detection
		  failure.  (John Hood)
		* Add an Appveyor/Cygwin CI build.
		* Improve warning-flags detection for 'make distcheck'.  (John Hood)
		* Improve robustness of regression tests.  (John Hood)
		* Support OpenBSD pledge() sandboxing.  (John Hood)
		* Use backward-compatible name for AES in
		  AppleCommonCrypto, fixing builds with older OS X SDKs.  (John Hood)
		* Detect clock_gettime() and CLOCK_MONOTONIC carefully,
		  fixing OS X 10.12 + Xcode 7.3 builds.  (John Hood)
		* Support older versions of Perl, back to 5.10, fixing
		  RHEL 5 builds. (Anders Kaseorg)
		* Add a Travis OS X CI and release build.  (John Hood)
		* Add --help and --version, enabling Automake's
		 'std-options' checks.  (Anders Kaseorg)
		* Add a simple smoke test not requiring tmux, to help
		  validate builds on older platforms including RHEL 5. (Anders Kaseorg)
		* Check for presence of clock_gettime() for OS X, where
		  the symbol may not be resolved on older OS X versions.  (John
		  Hood)
		* Fix a memory alignment issue in OCB with ARM/Neon. (Carlos Cabanero)
		* Mosh now runs correctly on Bash for Windows with Windows 10
		  Insider builds 15002 and higher. (No change in Mosh)
		* Other minor platform compatibility fixes for Mosh
		  sources and tests.  (John Hood)

	* Bug fixes:
		* Work around a pty buffering issue causing failed
		  connections on FreeBSD 11, or with Dropbear.  (John Hood)
		* Restore '-p 0' option for OS-selected UDP port bindings.  (John Hood)
		* Shell hygiene fixes, including better quoting of
		  pathnames.  (Anders Kaseorg)
		* Fix typos in project docs.  (Jakub Wilk)
		* Fix excess newlines on mosh client startup/shutdown.  (John Hood)
		* Exit gracefully, closing session, on pty write or ioctl failure.  (John Hood)
		* Fix two bugs that caused mosh-server to consume
		  excessive CPU in certain circumstances.  (John Hood)
		* Fix bug that caused text copied from mosh-client to
		  paste as long lines joined by spaces.  (John Hood)
		* Documentation improvements. (chenxiaoqino, Ashish Gupta)
		* Use getuid(), not geteuid(), for correct getpw* lookups.  (John Hood)

2016-08-10 Keith Winstein <mosh-devel@mit.edu>

	* Version 1.2.6 released.

	* New features:
		* Add Travis CI builds for Linux and Mac.  (Anders Kaseorg, others)
		* Add a --local option to run without ssh.  (John Hood)
		* Mosh now returns exitstatus reflecting connection success.
		  (John Hood)
		* Add an end-to-end test suite and many tests.  (John Hood)
		* Implement timeouts and signals to help address orphaned sessions.
		  (John Hood)
		* Major rework of Mosh's display differencing/rendering
		  code with much improved performance for slow machines.  (John Hood)
		* Implement ANSI back/forward tab (CSI CBT, CSI CHT).
		  (John Hood)
		* Do not start user shell until network session starts.
		  (John Hood)
		* Add options for more flexible specification of IPv4/IPv6
		  hostname resolution.  (John Hood)
		* Improved bash completion.  (Steve Dignam, HIGUCHI Yuta)
		* Add options for different methods of resolving the remote host
		  address, allowing operation without SshProxyCommand.  (John Hood)

	* Platform support:
		* Add configurable support for Apple Common Crypto and
		  Nettle, in place of OpenSSL.  Implement base64 locally.
		  (John Hood)
		* Workaround Cygwin select() bug.  (John Hood)
		* Updates to Debian packaging.  (Anders Kaseorg, Keith Winstein)
		* Workaround a glibc-2.22 issue causing segfaults on Debian Sid.
		  (John Hood with help from many others)
		* Prefer c++ to g++, for systems like FreeBSD where g++ is not usable.
		  (John Hood)
		* Fixes for Illumos Hipster 20151003.  (John Hood)
		* Disable -Werror for protobuf code, to resolve a new gcc6 warning.
		  (John Hood)
		* Link test for -fstack-protector-all on an embedded platform.
		  (Baruch Siach)
		* Resolve issue with bswap64() on FreeBSD-CURRENT with libc++-3.8.0.
		  (John Hood)
		* Fix issue with RECVTOS error message on client on FreeBSD.
		  (John Hood)

	* Bug fixes:
		* Remove an assertion causing aborts on Unicode fallback found by
		  fuzzing with afl.  (Keith Winstein)
		* Fix a server hang with XON/XOFF on BSD systems.  (John Hood)
		* Fix a typeahead-prediction bug that caused display corruption on
		  urxvt.  (John Hood)

2015-07-12 Keith Winstein <mosh-devel@mit.edu>

       * Version 1.2.5 released.

       * New features:
               * Bind to a specific IP address with --bind-server. (Philipp
		 Haselwarter)
               * MOSH_ESCAPE_KEY configures escape character.  (Timo
		 J. Rinne)
               * Support non-roaming IPv6. (Anders Kaseorg)
               * Implement XTerm mouse mode. (Barosl LEE, Andrew Chin,
		 Louis Kruger)
               * Report Git revision along with version if available.
		 (John Hood)

       * Platform support:
               * Add pselect() emulation. (Jérémie Courrèges-Anglas)
               * OpenBSD, OS X: Fix be64toh-related issues. (Jérémie
		 Courrèges-Anglas)
               * ARM Neon: fix gcc4.8 compiling problem(Pasi Sjöholm)
               * NaCl: Conditionally rename main to mosh_main. (Richard
		 Woodbury)
               * FreeBSD: Token pasting, forkpty(), ARM fixes. (John Hood)
               * AIX: Implement CTTY grabbing when TIOCSCTTY is missing
                 (Anton Lundin)
	       * OS X: Broaden build support to cover OS X 10.5 through
		 10.10. (John Hood)
	       * Debian: Improve bash-completion install and
		 functionality. (Suggested by Gabriel Filion, John Hood)

       * Bug fixes:
               * Automake/autoconf workarounds.  (Anders Kaseorg)
               * mosh-server: Allow startup without PTY.  (Keith Winstein)
               * network.cc: Properly close old fd on Socket assignment
		 operator. (Thanks to Igor Bukanov)
               * mosh-server:  Allow startup with zero-window-size PTY.
                 (Igor Bukanov)
               * AddrInfo: Fix error message generation when node == NULL
                 (Anders Kaseorg)
               * Timestamp: Prevent integer overflow on Darwin PPC 32-bit
                 (Anders Kaseorg)
               * scripts/mosh: Fix hang when remote closes the connection
                 (Anders Kaseorg)
               * Fix issues with parsing of 256-color SGR sequences.
                 (John Hood)
               * Numerous code hygiene, Coverity, and Clang static analyzer
                 fixes.  (Anders Kaseorg, Geoffrey Thomas, John Hood)

2013-03-27 Keith Winstein <mosh-devel@mit.edu>

	* Version 1.2.4 released.

	* New features:
	        * Support port ranges with -p LOWPORT:HIGHPORT (Luke Mewburn)
	        * Ctrl-^ Ctrl-Z suspends mosh client (Nikolai Zeldovich)
	        * mm:ss display of lost-contact times (Kevin Ballard)
	        * Show infobar with control chars when Ctrl-^ is typed
	        * Put terminal in altscreen mode (Anders Kaseorg)
	        * Tell automake/Debian pkg about our checks (Anders Kaseorg)

	* Platform support:
	        * OS X: Script to build a universal package (Peter Iannucci)
	        * FreeBSD: Fix build problems (Jimmy Olgeni)
	        * AIX: port by Anton Lundin
	        * Solaris with system curses (Anton Lundin)
	        * Cygwin and others: eliminate use of IO::Pty (Anton Lundin)

	* Bug fixes:
	        * Fix bug (introduced in 1.2.3) where server stays around
	          if process quits while client is detached
	        * Clean up spurious entries from detached sessions warning
		* Fix freeze when connectivity is one-directional for hours
	          (reported by Axel Beckert)
	        * Don't wipe title until a new one is set (sqweek)
	        * Eliminate memory leaks and cppcheck warnings (Anders Kaseorg)

2012-10-19 Keith Winstein <mosh-devel@mit.edu>

	* Version 1.2.3 released.

	* Security improvements:
		* Use OpenSSL AES implementation
		* Update AES-OCB implementation (Keegan McAllister)
		* Don't let bad server dictate IP (Felix Groebert)

	* New features:
		* Client hops ports to survive challenging client-side firewall
		* Server stops sending to save client power (Daniel Drown)
		* Set DiffServ code point and ECN-capable (Dave Täht)
		* Slow down if explicit congestion notification received
		* Warn about unattached Mosh sessions on login
		* Compatible with KDE konsole (uses BEL to terminate OSC)
		* Improved heuristic about color of predicted characters

	* Bug fixes:
		* Improved performance on systems with expensive time
		* No longer choke on "ffff::" address for hosts with IPv6
		* More conservative MTU and datagram sizing

	* Platform support:
		* Build on Solaris and IllumOS (Timo Sirainen, Ira Cooper)
		* Build on ARM with gcc 4.7 (Alexander Chernyakhovsky)

	* Licensing changes:
		* Allow distribution on Apple App Stores
		* Allow linking with OpenSSL

2012-06-12 Keith Winstein <mosh-devel@mit.edu>

	* Version 1.2.2 released.

	* Remove warning on out-of-order/duplicated datagrams

	* Add "experimental" prediction mode

2012-05-25 Keith Winstein <mosh-devel@mit.edu>

	* Version 1.2.1 released.

	* Improve performance on lossy links.

	* New diagnostic message when link is dead in only one direction.

	* Use less CPU when link is down. (Keegan McAllister)

	* Use much less CPU when application or mosh-server sends
	  large repeat counts (resolves CVE-2012-2385, reported by
	  Timo Juhani Lindfors).

	* Use less memory when mosh-server is malicious.

	* Fix vttest regression re: wrapping and tabs.

	* Enable roundtrip verifier of terminal emulator correctness
	  when verbose.

	* Remove skalibs as a dependency. (Keegan McAllister)

	* Remove use of poll() and OS X poll workaround. (Keegan McAllister)

	* Include bash_completion file. (ejeffrey)

	* Include UFW firewall profile. (Fumihito YOSHIDA)

	* Warning on out-of-order/duplicated datagrams
	  (or failed nonce increment).

	* Clearer error message on invalid port number.

	* Cleanups to quit scenario when firewalled.

2012-04-26 Keith Winstein <mosh-devel@mit.edu>

	* Version 1.2 released.

	* Remove Boost as a dependency (Keegan McAllister)

	* Add support for FreeBSD, Cygwin, RHEL/CentOS 5, OS X 10.5 on PPC.

	* More verbose and helpful diagnostics. Server now has -v flag.

	* Client now has --ssh= flag to set SSH options (like port)

	* Remove skalibs as a dependency on Debian/Ubuntu (Keegan McAllister)

	* Now passes locale-related env vars over the connection

	* Fix startup script to no longer hang on some Macs (Jay Freeman)

	* Fix terminal emulation and argument parsing on FreeBSD

	* Fix alignment problems on ARM

	* Now prints message of the day

	* Use binary hardening flags where available (Keegan McAllister)

	* Responsiveness and CPU-usage improvements

	* Several terminal-emulation improvements and bug fixes

2012-04-03 Keith Winstein <mosh-devel@mit.edu>

	* Version 1.1.3 released.

	* Builds on armel, armhf, and kFreeBSD.

	* Fixes bug causing occasional missing/extra wraparound copy-and-paste.

	* Eliminates valgrind complaint over unused winsize fields.

	* Close connection after four petabytes (per OCB recommendation).

2012-03-28 Keith Winstein <mosh-devel@mit.edu>

	* Version 1.1.2 released.

	* Fixes to build on OS X 10.5 with older gcc and -lpoll (Quentin Smith)

	* Add --with-utempter and --without-utempter per gentoo request
	  (Michael Weber)

	* configure now requires ncurses headers (and others) to be installed

	* Consolidate locale routines to help Android port (Keegan McAllister)

2012-03-27 Keith Winstein <mosh-devel@mit.edu>

	* Version 1.1.1 released.

	* Fix spec file and build failure on Fedora.

	* Print out error message properly on fatal_assert().

	* Support for machines without posix_memalign().

2012-03-22 Keith Winstein <mosh-devel@mit.edu>

	* Version 1.1 released (stable release).

	* Allows user to specify remote command to execute.

	* Only advertises 256 colors when user's terminal has 256 colors.

	* Add chaff to datagrams to frustrate statistical analysis of length

	* Cosmetic fixes to terminal handling

	* Improved startup script (Anders Kaseorg)

2012-03-16 Keith Winstein <mosh-devel@mit.edu>

	* Version 1.0.2 released.

	* Uses xterm-256color and supports 256-color escape sequences.

	* Posterizes to 8 colors unless the user has a 256-color terminal.

	* Handles terminals without BCE.

	* Starts login shell.

2012-03-14 Keith Winstein <mosh-devel@mit.edu>

	* Version 1.0.1 released.

	* Roughly 40% less CPU usage.

2012-03-12 Keith Winstein <mosh-devel@mit.edu>

	* Version 1.0 released.

	* mosh now supports --version option and prints no-warranty message.

2012-03-10 Keith Winstein <mosh-devel@mit.edu>

	* Version 0.98 released.

	* Add option to select server-side UDP port.

	* Restrict default UDP port range to 60000..61000.

	* Use TERM / terminfo to decide when to send ECH sequence.

	* Now works properly inside tmux.

2012-03-07 Keith Winstein <mosh-devel@mit.edu>

	* Version 0.97 released.

	* Merged Mac OS X port (thanks to Quentin Smith and Anders Kaseorg)

	* Server will quit if no connection within first 60 seconds

	* Startup script no longer requires threaded Perl

	* Add --enable-compile-warnings=error to ./configure

	* Fix some flicker issues with adaptive prediction mode

2012-02-26 Keith Winstein <mosh-devel@mit.edu>

	* Version 0.96 released.

	* Compress all instructions with zlib

2012-02-25 Keith Winstein <mosh-devel@mit.edu>

	* Version 0.95 released.

	* Make echo acknowledgment reliable to reduce spurious mispredict detections.

	* Require two dropped heartbeats before showing blue bar of lost contact

	* Print newline before MOSH CONNECT string to make more robust if intermediate keys hit

	* Disable ControlMaster in initial SSH connection so proxy is always used

	* Make retransmissions occur at frame rate (vs. every 3 seconds) for limited time after loss

2012-02-15 Keith Winstein <mosh-devel@mit.edu>

	* Version 0.94 released.

	* Make man pages

	* Replace C++11 features (lambda and auto) with boost equivalents
	(Anders Kaseorg)

	* Now builds with g++ or clang (with libstdc++)

2012-02-13 Keith Winstein <mosh-devel@mit.edu>

	* Version 0.93 released.

	* Make utmp entries

2012-02-13 Keith Winstein <mosh-devel@mit.edu>

	* Version 0.92 released.

	* Allows user to select prediction mode (always/never/adaptive)

	* Fix bug in server startup on slow hosts

	* Better prediction when deleting at line ending

2012-02-09 Keith Winstein <mosh-devel@mit.edu>

	* Version 0.91 released.

	* Startup script support SSH options and aliases (Anders Kaseorg)

	* End use of Path MTU discovery and allow IP fragmentation because,
	e.g., Cisco VPN has MTU of 1200 and does not pass ICMP too-big.

	* Better exception and error handling.

	* Restrict predictive local echo display to long-delay links
	(>60 ms RTT) or for temporarily after a "glitch." Otherwise simply
	show server echos, while maintaining prediction overlay in the
	background in case it is needed.

2012-02-07 Keith Winstein <mosh-devel@mit.edu>

	* Version 0.9b released.
	* Improvements to build system (Anders Kaseorg)

2012-02-06 Keith Winstein <mosh-devel@mit.edu>

	* Version 0.9 released.


================================================
FILE: Makefile.am
================================================
# Work around inconsistency in AX_CODE_COVERAGE defining
# AM_DISTCHECK_CONFIGURE_FLAGS only in some branches
if !CODE_COVERAGE_ENABLED
AM_DISTCHECK_CONFIGURE_FLAGS =
endif

include $(top_srcdir)/aminclude_static.am

ACLOCAL_AMFLAGS = -I m4
SUBDIRS = scripts src man conf
EXTRA_DIST = autogen.sh ocb-license.html README.md COPYING.iOS
BUILT_SOURCES = VERSION.stamp
AM_DISTCHECK_CONFIGURE_FLAGS += --enable-compile-warnings=distcheck --enable-examples --enable-syslog

# AX_CODE_COVERAGE configuration

# Remove everything outside of this repository
CODE_COVERAGE_IGNORE_PATTERN = "/usr/include/*" "/usr/lib/*" "*/src/tests/*" "*/src/protobufs/*"

# Ensure coverage is relative to the top of the repository
CODE_COVERAGE_DIRECTORY = $(abs_top_builddir)

# non-Automake defines
CPPCHECK_FLAGS = --enable=all --template=gcc --force # -j8 disables unused function checking.
CLANG_SCAN_BUILD = scan-build
BEAR = bear
OCLINT_JCD = oclint-json-compilation-database
OCLINT_OPTIONS = -enable-global-analysis -max-priority-2=1000 -max-priority-3=1000 \
	-rc LONG_LINE=160 \
	-rc LONG_VARIABLE_NAME=40 \
	-rc SHORT_VARIABLE_NAME=1 \
	-rc MINIMUM_CASES_IN_SWITCH=2

.PHONY:	VERSION.stamp

VERSION.stamp:
	@echo @PACKAGE_STRING@ > VERSION.dist
	@set -e; if git describe --dirty --always > VERSION.git 2>&1 && \
		[ -z `git rev-parse --show-prefix` ]; then \
		if ! diff -q VERSION.git VERSION.stamp > /dev/null 2>&1; then \
			mv -f VERSION.git VERSION.stamp; \
		fi; \
	elif ! diff -q VERSION.dist VERSION.stamp > /dev/null 2>&1; then \
		mv -f VERSION.dist VERSION.stamp; \
	fi
	@rm -f VERSION.dist VERSION.git

clean-local:
	@rm -rf VERSION.stamp cov-int mosh-coverity.txz compile_commands.json

# Linters and static checkers, for development only.  Not included in
# build dependencies, and outside of Automake processing.
cppcheck:
	cppcheck $(CPPCHECK_FLAGS) -include src/include/config.h -I src/include \
		-I src/crypto -I src/frontend -I src/network -I src/protobufs \
		-I src/statesync -I src/terminal -I src/util \
		-I /usr/include -I /usr/include/google/protobuf -I/usr/include/openssl \
		src

# Coverity.
cov-build:
	$(MAKE) clean
	rm -rf cov-int
	cov-build --dir cov-int $(MAKE) check TESTS=
	tar -caf mosh-coverity.txz cov-int

# These two rules are for Bear + OCLint.
# Don't *run* the tests, prediction-unicode.test generates arguments
# with illegal UTF-8 that make Bear unhappy.
compile_commands.json:
	$(MAKE) clean
	bear $(MAKE) check TESTS=
oclint: compile_commands.json
	$(OCLINT_JCD) -e src/protobufs -- $(OCLINT_OPTIONS)

# Clang's scan-build static checker.
scan-build:
	$(MAKE) clean
	$(CLANG_SCAN_BUILD) $(MAKE) check TESTS=


================================================
FILE: NEWS
================================================
2012-04-26
----------

* Version 1.2 released

2012-03-22
----------

* Version 1.1 released

2012-03-12
----------

* Version 1.0 released

2012-03-07 Release candidate (0.97):
------------------------------------

* Now builds on Mac OS X as well as GNU/Linux

2012-02-06 Initial release (0.9):
---------------------------------

* Supports intermittent connectivity
* Supports client and server IP roaming
* Local echo supports typing and the left and right arrow keys


================================================
FILE: README.md
================================================
[![ci](https://github.com/mobile-shell/mosh/actions/workflows/ci.yml/badge.svg)](https://github.com/mobile-shell/mosh/actions/workflows/ci.yml)

Mosh: the mobile shell
======================

Mosh is a remote terminal application that supports intermittent
connectivity, allows roaming, and provides speculative local echo
and line editing of user keystrokes.

It aims to support the typical interactive uses of SSH, plus:

   * Mosh keeps the session alive if the client goes to sleep and
     wakes up later, or temporarily loses its Internet connection.

   * Mosh allows the client and server to "roam" and change IP
     addresses, while keeping the connection alive. Unlike SSH, Mosh
     can be used while switching between Wi-Fi networks or from Wi-Fi
     to cellular data to wired Ethernet.

   * The Mosh client runs a predictive model of the server's behavior
     in the background and tries to guess intelligently how each
     keystroke will affect the screen state. When it is confident in
     its predictions, it will show them to the user while waiting for
     confirmation from the server. Most typing and uses of the left-
     and right-arrow keys can be echoed immediately.

     As a result, Mosh is usable on high-latency links, e.g. on a
     cellular data connection or spotty Wi-Fi. In distinction from
     previous attempts at local echo modes in other protocols, Mosh
     works properly with full-screen applications such as emacs, vi,
     alpine, and irssi, and automatically recovers from occasional
     prediction errors within an RTT. On high-latency links, Mosh
     underlines its predictions while they are outstanding and removes
     the underline when they are confirmed by the server.

Mosh does not support X forwarding or the non-interactive uses of SSH,
including port forwarding.

Other features
--------------

   * Mosh adjusts its frame rate so as not to fill up network queues
     on slow links, so "Control-C" always works within an RTT to halt
     a runaway process.

   * Mosh warns the user when it has not heard from the server
     in a while.

   * Mosh supports lossy links that lose a significant fraction
     of their packets.

   * Mosh handles some Unicode edge cases better than SSH and existing
     terminal emulators by themselves, but requires a UTF-8
     environment to run.

   * Mosh leverages SSH to set up the connection and authenticate
     users. Mosh does not contain any privileged (root) code.

Getting Mosh
------------

  [The Mosh web site](https://mosh.org/#getting) has information about
  packages for many operating systems, as well as instructions for building
  from source.

  Note that `mosh-client` receives an AES session key as an environment
  variable.  If you are porting Mosh to a new operating system, please make
  sure that a running process's environment variables are not readable by other
  users.  We have confirmed that this is the case on GNU/Linux, OS X, and
  FreeBSD.

Usage
-----

  The `mosh-client` binary must exist on the user's machine, and the
  `mosh-server` binary on the remote host.

  The user runs:

    $ mosh [user@]host

  If the `mosh-client` or `mosh-server` binaries live outside the user's
  `$PATH`, `mosh` accepts the arguments `--client=PATH` and `--server=PATH` to
  select alternate locations. More options are documented in the mosh(1) manual
  page.

  There are [more examples](https://mosh.org/#usage) and a
  [FAQ](https://mosh.org/#faq) on the Mosh web site.

How it works
------------

  The `mosh` program will SSH to `user@host` to establish the connection.
  SSH may prompt the user for a password or use public-key
  authentication to log in.

  From this point, `mosh` runs the `mosh-server` process (as the user)
  on the server machine. The server process listens on a high UDP port
  and sends its port number and an AES-128 secret key back to the
  client over SSH. The SSH connection is then shut down and the
  terminal session begins over UDP.

  If the client changes IP addresses, the server will begin sending
  to the client on the new IP address within a few seconds.

  To function, Mosh requires UDP datagrams to be passed between client
  and server. By default, `mosh` uses a port number between 60000 and
  61000, but the user can select a particular port with the -p option.
  Please note that the -p option has no effect on the port used by SSH.

Advice to distributors
----------------------

A note on compiler flags: Mosh is security-sensitive code. When making
automated builds for a binary package, we recommend passing the option
`--enable-compile-warnings=error` to `./configure`. On GNU/Linux with
`g++` or `clang++`, the package should compile cleanly with
`-Werror`. Please report a bug if it doesn't.

Where available, Mosh builds with a variety of binary hardening flags
such as `-fstack-protector-all`, `-D_FORTIFY_SOURCE=2`, etc.  These
provide proactive security against the possibility of a memory
corruption bug in Mosh or one of the libraries it uses.  For a full
list of flags, search for `HARDEN` in `configure.ac`.  The `configure`
script detects which flags are supported by your compiler, and enables
them automatically.  To disable this detection, pass
`--disable-hardening` to `./configure`.  Please report a bug if you
have trouble with the default settings; we would like as many users as
possible to be running a configuration as secure as possible.

Mosh ships with a default optimization setting of `-O2`. Some
distributors have asked about changing this to `-Os` (which causes a
compiler to prefer space optimizations to time optimizations). We have
benchmarked with the included `src/examples/benchmark` program to test
this. The results are that `-O2` is 40% faster than `-Os` with g++ 4.6
on GNU/Linux, and 16% faster than `-Os` with clang++ 3.1 on Mac OS
X. In both cases, `-Os` did produce a smaller binary (by up to 40%,
saving almost 200 kilobytes on disk). While Mosh is not especially CPU
intensive and mostly sits idle when the user is not typing, we think
the results suggest that `-O2` (the default) is preferable.

Our Debian and Fedora packaging presents Mosh as a single package.
Mosh has a Perl dependency that is only required for client use.  For
some platforms, it may make sense to have separate mosh-server and
mosh-client packages to allow mosh-server usage without Perl.

Notes for developers
--------------------

To start contributing to Mosh, install the following dependencies:

Debian, Windows Subsystem for Linux:

```
$ sudo apt install -y build-essential protobuf-compiler \
    libprotobuf-dev pkg-config libutempter-dev zlib1g-dev libncurses5-dev \
    libssl-dev bash-completion tmux less
```

Fedora, RHEL:

```
$ sudo dnf group install development-tools
$ sudo dnf install automake protobuf-compiler protobuf-devel libutempter-devel \
    zlib-ng-compat-devel ncurses-devel openssl-devel bash-completion tmux less \
    perl-diagnostics
```

MacOS:

```
$ brew install protobuf automake
```

Once you have forked the repository, run the following to build and test Mosh:

```
$ ./autogen.sh
$ ./configure
$ make
$ make check
```

Mosh supports producing code coverage reports by tests, but this feature is
disabled by default. To enable it, make sure `lcov` is installed on your
system. Then, configure and run tests:

```
$ ./configure --enable-code-coverage
$ make check-code-coverage
```

This will run all tests and produce a coverage report in HTML form that can be
opened with your favorite browser. Ideally, newly added code should strive for
90% (or better) incremental test coverage.

More info
---------

  * Mosh Web site:

    <https://mosh.org>

  * `mosh-devel@mit.edu` mailing list:

    <https://mailman.mit.edu/mailman/listinfo/mosh-devel>

  * `mosh-users@mit.edu` mailing list:

    <https://mailman.mit.edu/mailman/listinfo/mosh-users>

  * `#mosh` channel on [Libera Chat](https://libera.chat/)

    https://web.libera.chat/#mosh


================================================
FILE: THANKS
================================================
* Hari Balakrishnan, who advised this work and came up with the name.

* Paul Williams (www.vt100.net), whose reverse-engineered vt500 state
  diagram is the basis for the Mosh parser.

* The anonymous users who contributed session logs for tuning and
  measuring Mosh's predictive echo.

* Nickolai Zeldovich for helpful comments on the Mosh research paper.

* Richard Stallman for helpful discussion about the capabilities of
  the SUPDUP Local Editing Protocol.

* Nelson Elhage

* Christine Spang

* Stefie Tellex

* Joseph Sokol-Margolis

* Waseem Daher

* Bill McCloskey

* Austin Roach

* Greg Hudson

* Karl Ramm

* Alexander Chernyakhovsky

* Peter Iannucci

* Evan Broder

* Neha Narula

* Katrina LaCurts

* Ramesh Chandra

* Peter Jeremy

* Ed Schouten

* Ryan Steinmetz

* Jay Freeman

* Dave Täht

* Larry Doolittle

* Daniel Drown

* Timo Juhani Lindfors

* Timo Sirainen

* Ira Cooper

* Felix Gröbert

* Luke Mewburn

* Anton Lundin

* Philipp Haselwarter

* Timo J. Rinne

* Barosl Lee

* Andrew Chin

* Louis Kruger

* Jérémie Courrèges-Anglas

* Pasi Sjöholm

* Richard Woodbury

* Igor Bukanov

* Geoffrey Thomas

* Steve Dignam

* HIGUCHI Yuta

* Baruch Siach

* Adrien Destugues

* Giel van Schijndel


================================================
FILE: autogen.sh
================================================
#!/bin/sh

exec autoreconf -fi


================================================
FILE: build-package.sh
================================================
#!/bin/sh

gbp buildpackage --git-upstream-branch=master --git-upstream-tree=branch


================================================
FILE: build-source-package.sh
================================================
#!/bin/sh

gbp buildpackage --git-upstream-branch=master --git-upstream-tree=branch -S


================================================
FILE: conf/Makefile.am
================================================
completionsdir = @completions@
dist_completions_DATA =
nobase_dist_sysconf_DATA =

if INSTALL_UFW
  nobase_dist_sysconf_DATA += ufw/applications.d/mosh
endif

if INSTALL_COMPLETION
  dist_completions_DATA += bash-completion/completions/mosh
endif


================================================
FILE: conf/bash-completion/completions/mosh
================================================
# Bash completions for Mosh, the mobile shell.         -*- shell-script -*-

__mosh_init_completion()
{
    if declare -F _init_completions >/dev/null 2>&1; then
        _init_completion
    else
        COMPREPLY=()
        _get_comp_words_by_ref cur prev words cword
    fi
}

_mosh () {
    local cur

    __mosh_init_completion || return

    local simple_flags="-a -b -4 -6 -p"
    local flags="--client= --server= --predict= --family= --port= 
    --bind-server= --ssh= --no-init --help --version"

    if [[ "$cur" == --* && "$COMP_CWORD" == 1 ]]; then
        COMPREPLY=($(compgen -W "$flags" -- "$cur"))
    elif [[ "$cur" == -* && "$COMP_CWORD" == 1 ]]; then
        COMPREPLY=($(compgen -W "$simple_flags" -- "$cur"))
    else
        _known_hosts_real -a "$cur"
    fi
}

complete -o nospace -F _mosh mosh


================================================
FILE: conf/ufw/applications.d/mosh
================================================
[mosh]
title=Mosh (mobile shell)
description=Mobile shell that supports roaming and intelligent local echo
ports=60000:61000/udp


================================================
FILE: configure.ac
================================================
#                                               -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.

AC_PREREQ([2.61])
AC_INIT([mosh], [1.4.0], [mosh-devel@mit.edu])
AM_INIT_AUTOMAKE([foreign std-options -Wall -Werror -Wno-portability])
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
AC_CONFIG_SRCDIR([src/frontend/mosh-client.cc])
AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_HEADERS([src/include/config.h])
AC_LANG([C++])
AX_CODE_COVERAGE

# Checks for programs.
AC_PROG_CC([cc gcc clang])
AC_PROG_CXX([c++ g++ clang++])
AC_PROG_RANLIB
AC_PATH_PROG([PROTOC], [protoc], [])
AS_IF([test x"$PROTOC" = x],
  [AC_MSG_ERROR([cannot find protoc, the Protocol Buffers compiler])])

# automake 1.12 seems to require this, but automake 1.11 doesn't recognize it
m4_ifdef([AM_PROG_AR], [AM_PROG_AR])

# Protobuf transitively requires at least C++14, get ahead of the
# curve and require at least C++17.
AX_CXX_COMPILE_STDCXX([17])

WARNING_CXXFLAGS=""
PICKY_CXXFLAGS=""
DISTCHECK_CXXFLAGS=""
AC_ARG_ENABLE([compile-warnings],
  [AS_HELP_STRING([--enable-compile-warnings@<:@=no/yes/maximum/error/distcheck@:>@],
     [Turn on compiler warnings])],
  [case "$enableval" in
     no)
       ;;
     '' | yes)
       WARNING_CXXFLAGS="-Wall"
       ;;
     maximum)
       WARNING_CXXFLAGS="-Wall"
       PICKY_CXXFLAGS="-Wextra -Wno-long-long -Weffc++ -Wmissing-declarations"
       ;;
     error)
       # remove -Wno-c++17-extensions once protocolbuffers/protobuf#9181 is
       # resolved
       # remove -Wno-unused-parameter once
       # protocolbuffers/protobuf#10357 is resolved       
       WARNING_CXXFLAGS="-Wall -Werror -Wno-c++17-extensions"
       PICKY_CXXFLAGS="-Wextra -Wno-long-long -Weffc++ -Wmissing-declarations -Wno-unused-parameter"
       ;;
     distcheck)
       WARNING_CXXFLAGS="-Wall -Werror"
       PICKY_CXXFLAGS="-Wextra -Wno-long-long -Weffc++ -Wmissing-declarations"
       AX_CHECK_COMPILE_FLAG([-Wno-error=unused-parameter],
         [PICKY_CXXFLAGS="$PICKY_CXXFLAGS -Wno-error=unused-parameter"], [], [-Werror])
       AX_CHECK_COMPILE_FLAG([-Wno-error=c++11-extensions],
         [PICKY_CXXFLAGS="$PICKY_CXXFLAGS -Wno-error=c++11-extensions"], [], [-Werror])
       AX_CHECK_COMPILE_FLAG([-Wno-error=deprecated-declarations],
         [PICKY_CXXFLAGS="$PICKY_CXXFLAGS -Wno-error=deprecated-declarations"], [], [-Werror])
       AX_CHECK_COMPILE_FLAG([-Wno-error=nested-anon-types],
         [PICKY_CXXFLAGS="$PICKY_CXXFLAGS -Wno-error=nested-anon-types"], [], [-Werror])
       ;;
     *)
       AC_MSG_ERROR([Unknown argument '$enableval' to --enable-compile-warnings])
       ;;
   esac],
  [WARNING_CXXFLAGS="-Wall"])
AC_SUBST([WARNING_CXXFLAGS])
AC_SUBST([PICKY_CXXFLAGS])

# Check for fuzzing support before the flag wrapper, because if
# requested and missing the functionality is entirely nonexistent.
MISC_CXXFLAGS=""
AC_ARG_ENABLE([fuzzing],
  [AS_HELP_STRING([--enable-fuzzing],
    [Enable compiler and linker options to enable fuzz testing @<:@no/yes/libfuzzer@:>@])],
  [fuzzing="$enableval"
   case "$enableval" in
    no)
      ;;
    '' | yes | libfuzzer)
      AX_CHECK_COMPILE_FLAG([-fsanitize=fuzzer],
        [FUZZING_CFLAGS="$FUZZING_CFLAGS -fsanitize=fuzzer"], [
        AC_MSG_ERROR([Fuzzing requested, but compiler support not present])], [-Werror])
      ;;
    *)
     AC_MSG_ERROR(["Unknown argument '$enableval' to --enable-fuzzing])
     ;;
  esac],
  [fuzzing="no"])
AC_SUBST([FUZZING_CFLAGS])
AC_SUBST([MISC_CXXFLAGS])
AM_CONDITIONAL([ENABLE_FUZZING], [test x"$fuzzing" != xno])

AC_ARG_ENABLE([asan],
  [AS_HELP_STRING([--enable-asan],
    [Enable compiler and linker options to enable AddressSanitizer @<:@no@:>@])],
  [asan="$enableval"],
  [asan="no"])

AS_IF([test x"$asan" != x"no"], [
  AX_CHECK_COMPILE_FLAG([-fsanitize=address,leak],
  [MISC_CXXFLAGS="$MISC_CXXFLAGS -fsanitize=address,leak"], [
  AC_MSG_ERROR([ASAN requested, but compiler support not present])], [-Werror])
])
AC_SUBST([MISC_CXXFLAGS])

# We want to check for compiler flag support, but there is no way to make
# clang's "argument unused" warning fatal.  So we invoke the compiler through a
# wrapper script that greps for this message.

saved_CXX="$CXX"
saved_LD="$LD"
flag_wrap="$srcdir/scripts/wrap-compiler-for-flag-check"
CXX="$flag_wrap $CXX"
LD="$flag_wrap $LD"

AC_DEFUN([check_cxx_flag],
  [AX_CHECK_COMPILE_FLAG([$1], [$2], [$3], [-Werror $4])])
AC_DEFUN([check_link_flag],
  [AX_CHECK_LINK_FLAG([$1], [$2], [$3], [-Werror $4])])

AC_ARG_ENABLE([hardening],
  [AS_HELP_STRING([--enable-hardening],
    [Enable compiler and linker options to frustrate memory corruption exploits @<:@yes@:>@])],
  [hardening="$enableval"],
  [hardening="yes"])

HARDEN_CFLAGS=""
HARDEN_LDFLAGS=""
AS_IF([test x"$hardening" != x"no"], [
  check_cxx_flag([-fno-strict-overflow], [HARDEN_CFLAGS="$HARDEN_CFLAGS -fno-strict-overflow"])

  # This one will likely succeed, even on platforms where it does nothing.
  check_cxx_flag([-D_FORTIFY_SOURCE=2], [HARDEN_CFLAGS="$HARDEN_CFLAGS -D_FORTIFY_SOURCE=2"])

  check_link_flag([-fstack-protector-all],
   [HARDEN_CFLAGS="$HARDEN_CFLAGS -fstack-protector-all"
    check_cxx_flag([-Wstack-protector], [HARDEN_CFLAGS="$HARDEN_CFLAGS -Wstack-protector"],
      [], [-fstack-protector-all])
    check_cxx_flag([--param ssp-buffer-size=1], [HARDEN_CFLAGS="$HARDEN_CFLAGS --param ssp-buffer-size=1"],
      [], [-fstack-protector-all])])

  check_cxx_flag([-fPIE],
   [check_link_flag([-fPIE -pie],
     [HARDEN_CFLAGS="$HARDEN_CFLAGS -fPIE"
      HARDEN_LDFLAGS="$HARDEN_LDFLAGS -pie"],
     [check_link_flag([-fPIE -Wl,-pie],
       [HARDEN_CFLAGS="$HARDEN_CFLAGS -fPIE"
        HARDEN_LDFLAGS="$HARDEN_LDFLAGS -Wl,-pie"])])])

  check_link_flag([-Wl,-z,relro],
   [HARDEN_LDFLAGS="$HARDEN_LDFLAGS -Wl,-z,relro"
    check_link_flag([-Wl,-z,now], [HARDEN_LDFLAGS="$HARDEN_LDFLAGS -Wl,-z,now"])])])
AC_SUBST([HARDEN_CFLAGS])
AC_SUBST([HARDEN_LDFLAGS])

# Also check for a few non-hardening-related flags.
AX_CHECK_COMPILE_FLAG([-fno-default-inline],
  [MISC_CXXFLAGS="$MISC_CXXFLAGS -fno-default-inline"], [], [-Werror])
AX_CHECK_COMPILE_FLAG([-pipe],
  [MISC_CXXFLAGS="$MISC_CXXFLAGS -pipe"], [], [-Werror])
AC_SUBST([MISC_CXXFLAGS])

# End of flag tests.
CXX="$saved_CXX"
LD="$saved_LD"

AC_ARG_ENABLE([client],
  [AS_HELP_STRING([--enable-client], [Build the mosh-client program @<:@yes@:>@])],
  [build_client="$enableval"],
  [build_client="yes"])
AM_CONDITIONAL([BUILD_CLIENT], [test x"$build_client" != xno])

AC_ARG_ENABLE([server],
  [AS_HELP_STRING([--enable-server], [Build the mosh-server program @<:@yes@:>@])],
  [build_server="$enableval"],
  [build_server="yes"])
AM_CONDITIONAL([BUILD_SERVER], [test x"$build_server" != xno])

AC_ARG_ENABLE([examples],
  [AS_HELP_STRING([--enable-examples], [Build the miscellaneous programs in src/examples @<:@no@:>@])],
  [build_examples="$enableval"],
  [build_examples="no"])
AM_CONDITIONAL([BUILD_EXAMPLES], [test x"$build_examples" != xno])

AC_ARG_ENABLE([ufw],
  [AS_HELP_STRING([--enable-ufw], [Install firewall profile for ufw (Uncomplicated Firewall) @<:@no@:>@])],
  [install_ufw="$enableval"],
  [install_ufw="no"])
AM_CONDITIONAL([INSTALL_UFW], [test x"$install_ufw" != xno])

AC_ARG_ENABLE([completion],
  [AS_HELP_STRING([--enable-completion], [Install bash_completion rule @<:@no@:>@])],
  [install_completion="$enableval"],
  [install_completion="no"])
AM_CONDITIONAL([INSTALL_COMPLETION], [test x"$install_completion" != xno])

AC_ARG_ENABLE([syslog],
  [AS_HELP_STRING([--enable-syslog], [Enable connection logging in mosh-server @<:@no@:>@])],
  [enable_syslog="$enableval"],
  [enable_syslog="no"])
AS_IF([test x"$enable_syslog" != xno],
  [AC_CHECK_HEADERS([syslog.h],
    [AC_DEFINE([HAVE_SYSLOG], [1], [Define if syslog is available.])],
    [AS_IF([test x"$enable_syslog" = xcheck],
      [AC_MSG_WARN([Unable to find syslog.h.])],
      [AC_MSG_ERROR([--enable-syslog was given but syslog.h was not found.])])])])

# Checks for libraries.
AC_ARG_ENABLE([static-libraries],
  [AS_HELP_STRING([--enable-static-libraries], [Enable all static linking options below @<:@no@:>@])])

AC_ARG_ENABLE([static-libstdc++],
  [AS_HELP_STRING([--enable-static-libstdc++], [Link libstdc++ statically @<:@no@:>@])],
  [], [enable_static_libstdc__="$enable_static_libraries"])
AS_IF([test "$enable_static_libstdc__" = yes],
  [LDFLAGS="$LDFLAGS -static-libstdc++"])

AC_ARG_ENABLE([static-libgcc],
  [AS_HELP_STRING([--enable-static-libgcc], [Link libgcc statically @<:@no@:>@])],
  [], [enable_static_libgcc="$enable_static_libraries"])
AS_IF([test "$enable_static_libgcc" = yes],
  [LDFLAGS="$LDFLAGS -static-libgcc"])

AC_ARG_WITH([utempter],
  [AS_HELP_STRING([--with-utempter], [write utmp entries using libutempter @<:@check@:>@])],
  [with_utempter="$withval"],
  [with_utempter="check"])
AC_ARG_ENABLE([static-utempter],
  [AS_HELP_STRING([--enable-static-utempter], [Link utempter statically @<:@no@:>@])],
  [], [enable_static_utempter="$enable_static_libraries"])
AS_IF([test x"$with_utempter" != xno],
  [AC_CHECK_LIB([utempter], [utempter_remove_record],
    [UTEMPTER_LIBS=-lutempter
     AS_IF([test "$enable_static_utempter" = yes],
       [UTEMPTER_LIBS="-Wl,-Bstatic $UTEMPTER_LIBS -Wl,-Bdynamic"])
     LIBS="$UTEMPTER_LIBS $LIBS"
     AC_DEFINE([HAVE_UTEMPTER], [1], [Define if libutempter is available.])],
    [AS_IF([test x"$with_utempter" = xcheck],
      [AC_MSG_WARN([Unable to find libutempter; utmp entries will not be made.])],
      [AC_MSG_ERROR([--with-utempter was given but libutempter was not found.])])])])

AC_ARG_ENABLE([static-zlib],
  [AS_HELP_STRING([--enable-static-zlib], [Link zlib statically @<:@no@:>@])],
  [], [enable_static_zlib="$enable_static_libraries"])
AC_CHECK_LIB([z], [compress],
  [ZLIB_LIBS=-lz
   AS_IF([test "$enable_static_zlib" = yes],
     [ZLIB_LIBS="-Wl,-Bstatic $ZLIB_LIBS -Wl,-Bdynamic"])
   LIBS="$ZLIB_LIBS $LIBS"],
  [AC_MSG_ERROR([Unable to find zlib.])])

AC_SEARCH_LIBS([socket], [socket network])
AC_SEARCH_LIBS([inet_addr], [nsl])

AC_SEARCH_LIBS([clock_gettime], [rt])

# Checks for header files.
AC_CHECK_HEADERS(m4_normalize([
  fcntl.h
  langinfo.h
  limits.h
  locale.h
  netdb.h
  netinet/in.h
  stddef.h
  stdint.h
  inttypes.h
  stdlib.h
  string.h
  sys/ioctl.h
  sys/random.h
  sys/resource.h
  sys/socket.h
  sys/stat.h
  sys/time.h
  termios.h
  unistd.h
  wchar.h
  wctype.h
  ]), [], [AC_MSG_ERROR([Missing required header file.])])

AC_CHECK_HEADERS([pty.h util.h libutil.h paths.h])
AC_CHECK_HEADERS([endian.h sys/endian.h])
AC_CHECK_HEADERS([utmpx.h])
AC_CHECK_HEADERS([termio.h])
AC_CHECK_HEADERS([sys/uio.h])
AC_CHECK_HEADERS([memory tr1/memory])

# Checks for typedefs, structures, and compiler characteristics.
AC_C_INLINE
AC_TYPE_INT64_T
AC_TYPE_PID_T
AC_C_RESTRICT
AC_TYPE_SIZE_T
AC_TYPE_SSIZE_T
AC_TYPE_UINT16_T
AC_TYPE_UINT32_T
AC_TYPE_UINT64_T
AC_TYPE_UINT8_T
AC_TYPE_UINTPTR_T

# Checks for library functions.
AC_CHECK_FUNCS(m4_normalize([
  getentropy
  getrandom
  gettimeofday
  posix_memalign
  cfmakeraw
  pselect
  pledge
  ]))

# Start by trying to find the needed tinfo parts by pkg-config
PKG_CHECK_MODULES([TINFO], [tinfo],
  [AC_DEFINE([HAVE_CURSES_H], [1], [Define to 1 if <curses.h> is present])],
  [PKG_CHECK_MODULES([TINFO], [ncurses],
    [AC_DEFINE([HAVE_CURSES_H], [1], [Define to 1 if <curses.h> is present])],
    [AX_CHECK_LIBRARY([TINFO], [curses.h], [tinfo],
      [AC_DEFINE([HAVE_CURSES_H], [1], [Define to 1 if <curses.h> is present])
        AC_SUBST([TINFO_CFLAGS], ["$TINFO_CPPFLAGS"])
        AC_SUBST([TINFO_LIBS], ["$TINFO_LDFLAGS -ltinfo"])],)])])

# Then try to find it in a specific install dir
AC_ARG_WITH(curses, [AS_HELP_STRING([--with-curses=DIR], [Where curses is installed])],
    [if test $withval != yes; then
        cv_curses=$withval
    fi
    if test x$cv_curses != x/usr; then
        CURSES_LDFLAGS="-L${cv_curses}/lib"
        CURSES_CPPFLAGS="-I${cv_curses}/include"
    fi])

if test "x$ax_cv_have_TINFO" = xno ; then
    # save away old LDFLAGS/CPPFLAGS and check for curses with cv_curses
    old_LDFLAGS="$LDFLAGS"
    old_CPPFLAGS="$CPPFLAGS"
    LDFLAGS="$LDFLAGS $CURSES_LDFLAGS"
    CPPFLAGS="$CPPFLAGS $CURSES_CPPFLAGS"

    AX_WITH_CURSES
    # restore old LDFLAGS/CPPFLAGS
    LDFLAGS="$old_LDFLAGS"
    CPPFLAGS="$old_CPPFLAGS"

    if test "x$ax_cv_curses_which" = xno ; then
        AC_MSG_ERROR([requires either tinfo, NcursesW or Ncurses library])
    else
        AC_SUBST([TINFO_LIBS], ["$CURSES_LDFLAGS $CURSES_LIB"])
        AC_SUBST([TINFO_CFLAGS], ["$CURSES_CPPFLAGS"])
    fi
fi

AC_ARG_ENABLE([static-curses],
  [AS_HELP_STRING([--enable-static-curses], [Link curses statically @<:@no@:>@])],
  [], [enable_static_curses="$enable_static_libraries"])
AS_IF([test "$enable_static_curses" = yes],
  [TINFO_LIBS="-Wl,-Bstatic $TINFO_LIBS -Wl,-Bdynamic"])

dnl Default to OpenSSL, or OS X crypto library if found
AC_CHECK_HEADERS([CommonCrypto/CommonCrypto.h],
  [default_crypto_library="apple-common-crypto"],
  [default_crypto_library="openssl"]
)

dnl Allow user to select over the default.
AC_ARG_WITH(
  [crypto-library],
  [AS_HELP_STRING([--with-crypto-library=library], [build with the given crypto library, TYPE=openssl|nettle|apple-common-crypto @<:@default=openssl@:>@])],
  [
    case "${withval}" in
      openssl|openssl-with-internal-ocb|openssl-with-openssl-ocb|nettle|apple-common-crypto) ;;
      *) AC_MSG_ERROR([bad value ${withval} for --with-crypto-library]) ;;
    esac
  ],
  [with_crypto_library="$default_crypto_library"]
)

dnl Checks for chosen crypto library
PKG_CHECK_MODULES([OpenSSL], [openssl],
  [have_openssl=yes
    AC_CHECK_LIB([crypto], [AES_encrypt], [have_deprecated_openssl_aes=yes])
    AC_CHECK_LIB([crypto], [EVP_aes_128_ocb], [have_evp_aes_ocb=yes])],
  [:])
PKG_CHECK_MODULES([Nettle], [nettle], [have_nettle=yes], [:])
AS_CASE([$with_crypto_library],
  [openssl*],
    [AS_IF([test "x$have_openssl" != xyes],
       [AC_MSG_ERROR([OpenSSL crypto library not found])])
     AC_DEFINE([USE_OPENSSL_AES], [1], [Use OpenSSL library])
     AC_SUBST([CRYPTO_CFLAGS], ["$OpenSSL_CFLAGS"])
     AC_SUBST([CRYPTO_LIBS], ["$OpenSSL_LIBS -lcrypto"])])
case "${with_crypto_library}" in
  openssl|openssl-with-internal-ocb)
    AS_IF([test "x$have_deprecated_openssl_aes" != xyes],
      [AC_MSG_ERROR([found OpenSSL without AES support])])
    AM_CONDITIONAL([USE_AES_OCB_FROM_OPENSSL], [false])
    human_readable_cryptography_description='internal OCB, OpenSSL AES'
    ;;
  openssl-with-openssl-ocb)
    AS_IF([test "x$have_evp_aes_ocb" != xyes],
      [AC_MSG_ERROR([found OpenSSL without AES-OCB support])])
    AM_CONDITIONAL([USE_AES_OCB_FROM_OPENSSL], [true])
    human_readable_cryptography_description='OpenSSL OCB, OpenSSL AES'
    ;;
  nettle)
    AS_IF([test "x$have_nettle" != xyes],
      [AC_MSG_ERROR([Nettle crypto library not found])])
    AC_DEFINE([USE_NETTLE_AES], [1], [Use Nettle library])
    AC_SUBST([CRYPTO_CFLAGS], ["$Nettle_CFLAGS"])
    AC_SUBST([CRYPTO_LIBS], ["$Nettle_LIBS"])
    AM_CONDITIONAL([USE_AES_OCB_FROM_OPENSSL], [false])
    human_readable_cryptography_description='internal OCB, Nettle AES'
    ;;
  apple-common-crypto)
    AS_IF([test "x$ac_cv_header_CommonCrypto_CommonCrypto_h" != xyes],
      [AC_MSG_ERROR([Apple Common Crypto header not found])])
    AC_DEFINE([USE_APPLE_COMMON_CRYPTO_AES], [1], [Use Apple Common Crypto library])
    AM_CONDITIONAL([USE_AES_OCB_FROM_OPENSSL], [false])
    human_readable_cryptography_description='internal OCB, Apple Common Crypto AES'
    ;;
esac

AC_ARG_ENABLE([static-crypto],
  [AS_HELP_STRING([--enable-static-crypto], [Link crypto library statically @<:@no@:>@])],
  [], [enable_static_crypto="$enable_static_libraries"])
AS_IF([test "$enable_static_crypto" = yes],
  [CRYPTO_LIBS="-Wl,-Bstatic $CRYPTO_LIBS -Wl,-Bdynamic"])

AC_CHECK_DECL([forkpty],
  [AC_DEFINE([FORKPTY_IN_LIBUTIL], [1],
     [Define if libutil.h necessary for forkpty().])],
  , [[#include <sys/types.h>
#include <libutil.h>]])

AC_SEARCH_LIBS([forkpty], [util bsd], [
  AC_DEFINE([HAVE_FORKPTY],, [Define if you have forkpty().])
])

AC_MSG_CHECKING([whether FD_ISSET() argument is const])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/select.h>
class T {
public:
  fd_set fds;
  bool Fun( void ) const { return FD_ISSET( 0, &fds ); } };]],
[[T x = T(); return x.Fun();]])],
  [AC_DEFINE([FD_ISSET_IS_CONST], [1],
     [Define if FD_ISSET() fd_set argument is const.])
   AC_MSG_RESULT([yes])],
  [AC_MSG_RESULT([no])])

AC_MSG_CHECKING([whether std::shared_ptr is available])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <memory>
class T {
public:
  std::shared_ptr<int> Fun( void ) { return std::shared_ptr<int>( new int ( 0 ) ); } };]],
[[T x; return !!x.Fun();]])],
  [AC_DEFINE([HAVE_STD_SHARED_PTR], [1],
     [Define if std::shared_ptr is available.])
   AC_MSG_RESULT([yes])],
  [AC_MSG_RESULT([no])])

AC_MSG_CHECKING([whether std::tr1::shared_ptr is available])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <tr1/memory>
class T {
public:
  std::tr1::shared_ptr<int> Fun( void ) { return std::tr1::shared_ptr<int>( new int ( 0 ) ); } };]],
[[T x; return !!x.Fun();]])],
  [AC_DEFINE([HAVE_STD_TR1_SHARED_PTR], [1],
     [Define if std::tr1::shared_ptr is available.])
   AC_MSG_RESULT([yes])],
  [AC_MSG_RESULT([no])])

AC_MSG_CHECKING([whether clock_gettime() is supported])
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <time.h>
struct timespec ts;
]], [[return clock_gettime(CLOCK_MONOTONIC, &ts);]])],
  [AC_DEFINE([HAVE_CLOCK_GETTIME], [1],
     [Define if clock_gettime() is available.])
   AC_MSG_RESULT([yes])],
  [AC_MSG_RESULT([no])])

AC_CHECK_DECL([mach_absolute_time],
  [AC_DEFINE([HAVE_MACH_ABSOLUTE_TIME], [1],
     [Define if mach_absolute_time is available.])],
  , [[#include <mach/mach_time.h>]])


AC_CHECK_DECLS([__builtin_ctz])

AC_CHECK_DECLS([ffs], [], [],
  [[#include <strings.h>]])

AC_CHECK_DECLS([be64toh, betoh64, bswap64, __builtin_bswap64], [], [],
  [[#if defined(HAVE_ENDIAN_H)
#include <endian.h>
#elif defined(HAVE_SYS_ENDIAN_H)
#include <sys/types.h>
#include <sys/endian.h>
#endif]])

AS_IF([test x"$ac_cv_have_decl_be64toh" != xyes &&
       test x"$ac_cv_have_decl_betoh64" != xyes],
  [AC_CHECK_DECL([OSSwapHostToBigInt64],
     [AC_DEFINE([HAVE_OSX_SWAP], [1],
        [Define if OSSwapHostToBigInt64 and friends exist.])],
     [AC_MSG_WARN([Unable to find byte swapping functions; using built-in routines.])],
     [[#include <libkern/OSByteOrder.h>]])])

AC_CHECK_DECL([IP_MTU_DISCOVER],
  [AC_DEFINE([HAVE_IP_MTU_DISCOVER], [1],
     [Define if IP_MTU_DISCOVER is a valid sockopt.])],
  , [[#include <netinet/in.h>]])

AC_CHECK_DECL([IP_RECVTOS],
  [AC_DEFINE([HAVE_IP_RECVTOS], [1],
     [Define if IP_RECVTOS is a valid sockopt.])],
  , [[#include <netinet/in.h>]])

AC_CHECK_DECL([__STDC_ISO_10646__],
  [],
  [AC_MSG_WARN([C library doesn't advertise wchar_t is Unicode (OS X works anyway with workaround).])],
  [[#include <wchar.h>]])

AC_CHECK_DECL([IUTF8],
  [AC_DEFINE([HAVE_IUTF8], [1],
     [Define if IUTF8 is a defined termios mode.])],
  [AC_MSG_WARN([No IUTF8 termios mode; character-erase of multibyte character sequence probably does not work properly in canonical mode on this platform.])],
  [[#include <termios.h>]])

# Checks for protobuf
PKG_CHECK_MODULES([protobuf], [protobuf])

# On Debian Sid 2016-03-16ish at least, "pkgconfig --libs protobuf"
# gives us the bogus "-lprotobuf -pthread -lpthread"; remove
# "-lpthread" which misconfigures compile, causing a segfault in
# mosh-server.
AS_IF([echo "$protobuf_LIBS" | grep -q -- -pthread],
  [protobuf_LIBS="`echo $protobuf_LIBS | sed 's/-lpthread//g'`"])

AC_ARG_ENABLE([static-protobuf],
  [AS_HELP_STRING([--enable-static-protobuf], [Link protobuf statically @<:@no@:>@])],
  [], [enable_static_protobuf="$enable_static_libraries"])
AS_IF([test "$enable_static_protobuf" = yes],
  [protobuf_LIBS="-Wl,-Bstatic $protobuf_LIBS -Wl,-Bdynamic"],
  [AS_IF([test "$enable_static_libstdc__" = yes],
     [AC_MSG_ERROR([--enable-static-libstdc++ requires --enable-static-protobuf])])
   AS_IF([test "$enable_static_libgcc" = yes],
     [AC_MSG_ERROR([--enable-static-libgcc requires --enable-static-protobuf])])])

AC_MSG_CHECKING([whether protoc matches protobuf])
cat > conftest.proto <<'EOF'
syntax = "proto2";
option optimize_for = LITE_RUNTIME;
EOF
AS_IF([$PROTOC --cpp_out=. conftest.proto],
  [old_CPPFLAGS="$CPPFLAGS"
   CPPFLAGS="$CPPFLAGS $protobuf_CFLAGS"
   AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include "conftest.pb.h"]], [[]])],
    [AC_MSG_RESULT([yes])],
    [AC_MSG_RESULT([no])
     cat conftest.err
     AC_MSG_FAILURE([Could not build output generated by protoc ($PROTOC).
Check that protoc matches the installed protobuf headers and libraries.])])
   CPPFLAGS="$old_CPPFLAGS"],
  [AC_MSG_RESULT([no])
   AC_MSG_ERROR([Could not run protoc ($PROTOC).])])

# Bash completion needs to ask where it goes if >= 2.0 is installed.
AS_IF([test "$install_completion" != no],
  [PKG_CHECK_MODULES([BASH_COMPLETION], [bash-completion >= 2.0],
     [if test "$prefix" = "NONE"; then
        completions="`pkg-config --variable=completionsdir bash-completion`"
      else
        completions="`pkg-config --define-variable=prefix=$prefix --variable=completionsdir bash-completion`"
      fi],
     [completions="${sysconfdir}/bash_completion.d"])
   AC_SUBST([completions])])

AC_CONFIG_FILES([
  Makefile
  src/Makefile
  src/crypto/Makefile
  src/frontend/Makefile
  src/fuzz/Makefile
  src/include/Makefile
  src/network/Makefile
  src/protobufs/Makefile
  src/statesync/Makefile
  src/terminal/Makefile
  src/util/Makefile
  scripts/Makefile
  src/examples/Makefile
  src/tests/Makefile
  man/Makefile
  conf/Makefile
])
AC_OUTPUT

AC_MSG_NOTICE([ === Configuration results ===])
AC_MSG_NOTICE([Version:             $PACKAGE_VERSION])
AC_MSG_NOTICE([c++ compiler:        $CXX])
AC_MSG_NOTICE([Warning CXXFLAGS:    $WARNING_CXXFLAGS])
AC_MSG_NOTICE([Picky CXXFLAGS:      $PICKY_CXXFLAGS])
AC_MSG_NOTICE([Harden CFLAGS:       $HARDEN_CFLAGS])
AC_MSG_NOTICE([Cryptography:        $human_readable_cryptography_description])
AC_MSG_NOTICE([ =============================])


================================================
FILE: debian/changelog
================================================
mosh (1.4.0-2) UNRELEASED; urgency=medium

  * Remove Benjamin Barenblat from Uploaders.

 -- Benjamin Barenblat <bbaren@debian.org>  Mon, 19 Jan 2026 19:38:42 -0500

mosh (1.4.0-1) unstable; urgency=medium

  * New upstream release.

 -- Benjamin Barenblat <bbaren@debian.org>  Fri, 11 Nov 2022 22:33:06 -0500

mosh (1.3.2.95rc2-1) experimental; urgency=medium

  * New upstream release candidate.

 -- Benjamin Barenblat <bbaren@debian.org>  Wed, 26 Oct 2022 20:37:12 -0400

mosh (1.3.2-2) unstable; urgency=medium

  * Fix "mosh FTBFS with gcc 7" <remove default constructors>
    (Closes: #871030)

 -- Keith Winstein <keithw@mit.edu>  Thu, 24 Aug 2017 15:04:25 -0700

mosh (1.3.2-1) unstable; urgency=medium

  * Version 1.3.2 released to unstable.
  * Fixes Debian revision inversion of 1.3.1-rc3-1 > 1.3.1-1

 -- Keith Winstein <keithw@cs.stanford.edu>  Fri, 21 Jul 2017 14:41:44 -0700

mosh (1.3.1-1) unstable; urgency=medium

  * Version 1.3.1 released to unstable.

 -- Keith Winstein <keithw@cs.stanford.edu>  Thu, 20 Jul 2017 17:32:58 -0400

mosh (1.3.1-rc3-1) experimental; urgency=medium

  * Platform support:
    * Explicitly enable binding to both IPv4 and IPv6 addresses.
      (Giel van Schijndel)

  * Bug fixes:
    * In tests, explicitly set 80x24 tmux window, for newer versions
      of tmux.  (John Hood)

 -- Keith Winstein <keithw@cs.stanford.edu>  Wed, 19 Jul 2017 22:27:12 -0400

mosh (1.3.1~rc2-1) experimental; urgency=medium

  * Build fix.

 -- Keith Winstein <keithw@cs.stanford.edu>  Fri, 19 May 2017 19:25:51 -0400

mosh (1.3.1~rc1-1) experimental; urgency=medium

  * Platform support:
    * Restore perl 5.8.8 support for RHEL5.  (Alexander Chernyakhovsky)
    * Make tests detect UTF-8 locale with a helper executable.  (John Hood)
    * Don't print /etc/motd on IllumOS.  (John Hood)
    * Print {,/var}/run/motd.dynamic on Ubuntu.  (John Hood)
    * Fix build on Haiku. (Adrien Destugues)
    * Disable unicode-later-combining.test for tmux 2.4.
      This fixes build failures.  (John Hood)

  * Bug fixes:
    * Work around JuiceSSH rendering bug.  (John Hood)
    * Do not move cursor for SCROLL UP and SCROLL DOWN--
      fixes an issue with tmux 2.4.  (John Hood)

 -- Keith Winstein <keithw@cs.stanford.edu>  Thu, 18 May 2017 00:52:01 -0400

mosh (1.3.0-1) unstable; urgency=medium

  * Version 1.3.0 released to unstable.

 -- Keith Winstein <keithw@cs.stanford.edu>  Sat, 25 Mar 2017 12:55:31 -0700

mosh (1.3.0~rc3-1) experimental; urgency=medium

  * Workaround for Debian bug #817236 on buildds

 -- Keith Winstein <keithw@cs.stanford.edu>  Fri, 03 Mar 2017 02:21:02 -0800

mosh (1.3.0~rc2-1) unstable; urgency=medium

  * New features:
    * Change website URLs from http://mosh.mit.edu to
      https://mosh.org.  (Keith Winstein)
    * Add --no-ssh-pty option for Dropbear compatibility and
      other issues.
    * Switch to semantic versioning, making this version 1.3.0
      instead of 1.2.7.

  * Platform support:
    * Added nonce-incrementing test.  (Keith Winstein)
    * Add build-source-package.sh for Debian.  (Keith Winstein)
    * Fix CPPFLAGS handling possibly causing curses detection
      failure.  (John Hood)
    * Add an Appveyor/Cygwin CI build.
    * Improve warning-flags detection for 'make distcheck'.  (John Hood)
    * Improve robustness of regression tests.  (John Hood)
    * Support OpenBSD pledge() sandboxing.  (John Hood)
    * Use backward-compatible name for AES in
      AppleCommonCrypto, fixing builds with older OS X SDKs.  (John Hood)
    * Detect clock_gettime() and CLOCK_MONOTONIC carefully,
      fixing OS X 10.12 + Xcode 7.3 builds.  (John Hood)
    * Support older versions of Perl, back to 5.10, fixing
      RHEL 5 builds. (Anders Kaseorg)
    * Add a Travis OS X CI and release build.  (John Hood)
    * Add --help and --version, enabling Automake's
     'std-options' checks.  (Anders Kaseorg)
    * Add a simple smoke test not requiring tmux, to help
      validate builds on older platforms including RHEL 5. (Anders Kaseorg)
    * Check for presence of clock_gettime() for OS X, where
      the symbol may not be resolved on older OS X versions.  (John
      Hood)
    * Fix a memory alignment issue in OCB with ARM/Neon. (Carlos Cabanero)
    * Mosh now runs correctly on Bash for Windows with Windows 10
      Insider builds 15002 and higher. (No change in Mosh)
    * Other minor platform compatibility fixes for Mosh
      sources and tests.  (John Hood)

  * Bug fixes:
    * Work around a pty buffering issue causing failed
      connections on FreeBSD 11, or with Dropbear.  (John Hood)
    * Restore '-p 0' option for OS-selected UDP port bindings.  (John Hood)
    * Shell hygiene fixes, including better quoting of
      pathnames.  (Anders Kaseorg)
    * Fix typos in project docs.  (Jakub Wilk)
    * Fix excess newlines on mosh client startup/shutdown.  (John Hood)
    * Exit gracefully, closing session, on pty write or
      ioctl failure.  (John Hood)
    * Fix two bugs that caused mosh-server to consume
      excessive CPU in certain circumstances.  (John Hood)
    * Fix bug that caused text copied from mosh-client to
      paste as long lines joined by spaces.  (John Hood)
    * Documentation improvements. (chenxiaoqino, Ashish Gupta)
    * Use getuid(), not geteuid(), for correct getpw* lookups.  (John Hood)

 -- Keith Winstein <keithw@cs.stanford.edu>  Mon, 06 Feb 2017 23:38:41 -0800

mosh (1.2.6-1) unstable; urgency=low

  * Version 1.2.6 released.

 -- Keith Winstein <keithw@mit.edu>  Wed, 10 Aug 2016 01:02:31 -0700

mosh (1.2.5.95rc1-1) unstable; urgency=low

  * Version 1.2.6 released.

  * New features:
    * Add Travis CI builds for Linux and Mac.  (Anders Kaseorg, others)
    * Add a --local option to run without ssh.  (John Hood)
    * Mosh now returns exitstatus reflecting connection success.
      (John Hood)
    * Add a end-to-end test suite and many tests.  (John Hood)
    * Implement timeouts and signals to help address orphaned sessions.
      (John Hood)
    * Major rework of Mosh's display differencing/rendering
      code with much improved performance for slow machines.  (John Hood)
    * Implement ANSI back/forward tab (CSI CBT, CSI CHT).
      (John Hood)
    * Do not start user shell until network session starts.
      (John Hood)
    * Add options for more flexible specification of IPv4/IPv6
      hostname resolution.  (John Hood)
    * Improved bash completion.  (Steve Dignam, HIGUCHI Yuta)
    * Add options for different methods of resolving the remote host
      address, allowing operation without SshProxyCommand.  (John Hood)

  * Platform support:
    * Add configurable support for Apple Common Crypto and
      Nettle, in place of OpenSSL.  Implement base64 locally.
      (John Hood)
    * Workaround Cygwin select() bug.  (John Hood)
    * Updates to Debian packaging.  (Anders Kaseorg, Keith Winstein)
    * Workaround a glibc-2.22 issue causing segfaults on Debian Sid.
      (John Hood with help from many others)
    * Prefer c++ to g++, for systems like FreeBSD where g++ is not usable.
      (John Hood)
    * Fixes for Illumos Hipster 20151003.  (John Hood)
    * Disable -Werror for protobuf code, to resolve a new gcc6 warning.
      (John Hood)
    * Link test for -fstack-protector-all on an embedded platform.
      (Baruch Siach)
    * Resolve issue with bswap64() on FreeBSD-CURRENT with libc++-3.8.0.
      (John Hood)
    * Fix issue with RECVTOS error message on client on FreeBSD.
      (John Hood)

  * Bug fixes:
    * Remove an assertion causing aborts on Unicode fallback found by
      fuzzing with afl.  (Keith Winstein)
    * Fix a server hang with XON/XOFF on BSD systems.  (John Hood)
    * Fix a typeahead-prediction bug that caused display corruption on
      urxvt.  (John Hood)

 -- Keith Winstein <keithw@mit.edu>  Mon, 23 May 2016 20:43:00 -0400

mosh (1.2.5-2) unstable; urgency=medium

  * debian/rules: Work around protobuf/glibc build problem
    causing mosh-server segfault. (Closes: #817929) (John Hood)

 -- Keith Winstein <keithw@mit.edu>  Wed, 23 Mar 2016 22:05:34 -0700

mosh (1.2.5-1.1) unstable; urgency=medium

  * Non-maintainer upload.
  * debian/mosh.maintscript: Fix /etc/bash_completion.d/mosh removal, thanks
    to for the patch Jakub Wilk <jwilk@debian.org> (Closes: #803253)

 -- Laurent Bigonville <bigon@debian.org>  Sun, 31 Jan 2016 16:19:09 +0100

mosh (1.2.5-1) unstable; urgency=low

  * Version 1.2.5 released.

 -- Keith Winstein <keithw@mit.edu>  Sun, 12 Jul 2015 12:42:00 -0400

mosh (1.2.4.95rc2-1) unstable; urgency=low

  * Version 1.2.5 release candidate.

  * New features:
    * Bind to a specific IP address with --bind-server. (Philipp
      Haselwarter)
    * MOSH_ESCAPE_KEY configures escape character.  (Timo
      J. Rinne)
    * Support non-roaming IPv6. (Anders Kaseorg)
    * Implement XTerm mouse mode. (Barosl LEE, Andrew Chin,
      Louis Kruger)
    * Report Git revision along with version if available.
      (John Hood)

  * Platform support:
    * Add pselect() emulation. (Jérémie Courrèges-Anglas)
    * OpenBSD, OS X: Fix be64toh-related issues. (Jérémie
      Courrèges-Anglas)
    * ARM Neon: fix gcc4.8 compiling problem(Pasi Sjöholm)
    * NaCl: Conditionally rename main to mosh_main. (Richard
      Woodbury)
    * FreeBSD: Token pasting, forkpty(), ARM fixes. (John Hood)
    * AIX: Implement CTTY grabbing when TIOCSCTTY is missing
      (Anton Lundin)
    * OS X: Broaden build support to cover OS X 10.5 through
      10.10. (John Hood)
    * Debian: Improve bash-completion install and
      functionality. (Suggested by Gabriel Filion, John Hood)

  * Bug fixes:
    * Automake/autoconf workarounds.  (Anders Kaseorg)
    * mosh-server: Allow startup without PTY.  (Keith Winstein)
    * network.cc: Properly close old fd on Socket assignment
      operator. (Thanks to Igor Bukanov)
    * mosh-server:  Allow startup with zero-window-size PTY.
      (Igor Bukanov)
    * AddrInfo: Fix error message generation when node == NULL
      (Anders Kaseorg)
    * Timestamp: Prevent integer overflow on Darwin PPC 32-bit
      (Anders Kaseorg)
    * scripts/mosh: Fix hang when remote closes the connection
      (Anders Kaseorg)
    * Fix issues with parsing of 256-color SGR sequences.
      (John Hood)
    * Numerous code hygiene, Coverity, and Clang static analyzer
      fixes.  (Anders Kaseorg, Geoffrey Thomas, John Hood)

 -- Keith Winstein <keithw@mit.edu>  Mon, 08 Jun 2015 22:45:00 -0400

mosh (1.2.4a-1) unstable; urgency=low

  * Eliminate redundant ocb.cc test (fixes build warning on ARM/MIPS/s390)
  * Add explicit cast to int (fixes build warning on older gcc)

 -- Keith Winstein <keithw@mit.edu>  Wed, 27 Mar 2013 18:32:33 -0400

mosh (1.2.4-1) unstable; urgency=low

  * Version 1.2.4 released.

 -- Keith Winstein <keithw@mit.edu>  Wed, 27 Mar 2013 00:17:39 -0400

mosh (1.2.3.95rc1-1) unstable; urgency=low

  * Version 1.2.4 release candidate

  * New features:
    * Support port ranges with -p LOWPORT:HIGHPORT (Luke Mewburn)
    * Ctrl-^ Ctrl-Z suspends mosh client (Nikolai Zeldovich)
    * mm:ss display of lost-contact times (Kevin Ballard)
    * Show infobar with control chars when Ctrl-^ is typed
    * Put terminal in altscreen mode (Anders Kaseorg)
    * Tell automake/Debian pkg about our checks (Anders Kaseorg)

  * Platform support:
    * OS X: Script to build a universal package (Peter Iannucci)
    * FreeBSD: Fix build problems (Jimmy Olgeni)
    * AIX: port by Anton Lundin
    * Solaris with system curses (Anton Lundin)
    * Cygwin and others: eliminate use of IO::Pty (Anton Lundin)

  * Bug fixes:
    * Fix bug (introduced in 1.2.3) where server stays around
      if process quits while client is detached
    * Clean up spurious entries from detached sessions warning
    * Fix freeze when connectivity is one-directional for hours
      (reported by Axel Beckert)
    * Don't wipe title until a new one is set (sqweek)
    * Eliminate memory leaks and cppcheck warnings (Anders Kaseorg)

 -- Keith Winstein <keithw@mit.edu>  Sun, 10 Mar 2013 17:46:37 -0400

mosh (1.2.3-1) unstable; urgency=low

  * Version 1.2.3 released.

  * Update AES-OCB implementation (Keegan McAllister)

  * More conservative MTU and datagram sizing

 -- Keith Winstein <keithw@mit.edu>  Fri, 19 Oct 2012 15:21:54 -0400

mosh (1.2.2.95rc1-1) unstable; urgency=low

  * Security improvements:
    * Use OpenSSL AES implementation
    * Don't let bad server dictate IP (Felix Groebert)

  * New features:
    * Client hops ports to survive challenging client-side firewall
    * Server stops sending to save client power (Daniel Drown)
    * Set DiffServ code point and ECN-capable (Dave Täht)
    * Slow down if explicit congestion notification received
    * Warn about unattached Mosh sessions on login
    * Compatible with KDE konsole (uses BEL to terminate OSC)
    * Improved heuristic about color of predicted characters

  * Bug fixes:
    * Improved performance on systems with expensive time
    * No longer choke on "ffff::" address for hosts with IPv6

  * Platform support:
    * Build on Solaris and IllumOS (Timo Sirainen, Ira Cooper)
    * Build on ARM with gcc 4.7 (Alexander Chernyakhovsky)

  * Licensing changes:
    * Allow distribution on Apple App Stores
    * Allow linking with OpenSSL

 -- Keith Winstein <keithw@mit.edu>  Fri, 05 Oct 2012 19:45:51 -0400

mosh (1.2.2-1) unstable; urgency=low

  * Version 1.2.2 released.

  * Remove warning on out-of-order/duplicated datagrams

  * Add "experimental" prediction mode

 -- Keith Winstein <keithw@mit.edu>  Tue, 12 Jun 2012 14:52:17 -0400

mosh (1.2.1-1) unstable; urgency=low

  * Version 1.2.1 released.

  * Warning on out-of-order/duplicated datagrams (or failed nonce increment)

  * Clearer error message on invalid port number

 -- Keith Winstein <keithw@mit.edu>  Fri, 25 May 2012 18:03:31 -0400

mosh (1.2.0.97-1) unstable; urgency=low

  * Cosmetic cleanups to quit sequence when server is firewalled

 -- Keith Winstein <keithw@mit.edu>  Wed, 23 May 2012 12:16:47 -0400

mosh (1.2.0.96-1) unstable; urgency=low

  * Include bash_completion file (ejeffrey)

  * Include UFW firewall profile (Fumihito YOSHIDA)

 -- Keith Winstein <keithw@mit.edu>  Wed, 23 May 2012 07:05:54 -0400

mosh (1.2.0.95-1) unstable; urgency=low

  * Improve performance on lossy links.

  * New diagnostic message when link is dead in only one direction.

  * Use less CPU when link is down. (Keegan McAllister)

  * Use much less CPU when application or mosh-server sends
    large repeat counts (resolves CVE-2012-2385, reported by
    Timo Juhani Lindfors).

  * Use less memory when mosh-server is malicious.

  * Fix vttest regression re: wrapping and tabs.

  * Enable roundtrip verifier of terminal emulator correctness
    when verbose.

  * Remove skalibs as a dependency. (Keegan McAllister)

  * Remove use of poll() and OS X poll workaround. (Keegan McAllister)

 -- Keith Winstein <keithw@mit.edu>  Wed, 23 May 2012 03:36:13 -0400

mosh (1.2-1) unstable; urgency=low

  * Version 1.2 released.

 -- Keith Winstein <keithw@mit.edu>  Thu, 26 Apr 2012 01:35:59 -0400

mosh (1.1.99b-1) unstable; urgency=low

  * Update THANKS and copyright information

 -- Keith Winstein <keithw@mit.edu>  Wed, 25 Apr 2012 02:53:21 -0400

mosh (1.1.99a-1) unstable; urgency=low

  * Fix using broken system poll on OS X 10.6

 -- Keith Winstein <keithw@mit.edu>  Wed, 25 Apr 2012 02:30:44 -0400

mosh (1.1.99-1) unstable; urgency=low

  * Fix build problems on FreeBSD 7 and 8

 -- Keith Winstein <keithw@mit.edu>  Tue, 24 Apr 2012 23:52:22 -0400

mosh (1.1.98-1) unstable; urgency=low

  * Fix build problems on Cygwin

  * Fix build problems on Debian armel/armhf

  * Fix alignment problems on ARM

 -- Keith Winstein <keithw@mit.edu>  Tue, 24 Apr 2012 19:00:03 -0400

mosh (1.1.97-1) unstable; urgency=low

  * Revert use of protobufs' zero-copy gzip stream

 -- Keith Winstein <keithw@mit.edu>  Mon, 23 Apr 2012 22:53:44 -0400

mosh (1.1.96-1) unstable; urgency=low

  * Include binary hardening check script in GNU-style tar.gz

 -- Keith Winstein <keithw@mit.edu>  Mon, 23 Apr 2012 20:21:14 -0400

mosh (1.1.95-1) unstable; urgency=low

  * Eliminate PPC32 dependence on posix_memalign()

 -- Keith Winstein <keithw@mit.edu>  Sun, 22 Apr 2012 23:18:13 -0400

mosh (1.1.94e-1) unstable; urgency=low

  * Improve responsiveness on fast links

  * Include poll implementation for Mac OS X

  * Use protobufs' zero-copy gzip stream

 -- Keith Winstein <keithw@mit.edu>  Sun, 22 Apr 2012 16:59:25 -0400

mosh (1.1.94d-1) unstable; urgency=low

  * More helpful locale-related error messages

  * Improve prediction transparency

  * Honor .hushlogin

  * Set PWD to deal with home directories that are symlinks

  * Back off overlay frame rate when all timing tests have fired (saves CPU)

  * -v flag now makes server more verbose

 -- Keith Winstein <keithw@mit.edu>  Thu, 19 Apr 2012 02:44:48 -0400

mosh (1.1.94c-1) unstable; urgency=low

  * Further improved Debian rule to disable conflicting stack protector flags

 -- Keith Winstein <keithw@mit.edu>  Tue, 17 Apr 2012 04:17:08 -0400

mosh (1.1.94b-1) unstable; urgency=low

  * Improved Debian rule to disable conflicting stack protector flags

 -- Keith Winstein <keithw@mit.edu>  Tue, 17 Apr 2012 03:24:23 -0400

mosh (1.1.94a-1) unstable; urgency=low

  * Bump base version

 -- Keith Winstein <keithw@mit.edu>  Tue, 17 Apr 2012 02:36:30 -0400

mosh (1.1.94-2) unstable; urgency=low

  * Disable conflicting Debian/Ubuntu stack protector flags

 -- Keith Winstein <keithw@mit.edu>  Tue, 17 Apr 2012 02:15:41 -0400

mosh (1.1.94-1) unstable; urgency=low

  * Release pre-candidate for mosh 1.2

  * Remove Boost as a dependency (Keegan McAllister)

  * More friendly error messages in some common cases

  * Now passes locale-related env vars over the connection

  * Remove skalibs as a depenency on Debian/Ubuntu (Keegan McAllister)

  * Fix startup script to no longer hang on some Macs (Jay Freeman)

  * Fix argument parsing on FreeBSD (Daniel O'Connor)

  * Use binary hardening flags where available (Keegan McAllister)

  * Several improvements to terminal emulation correctness

  * Now prints message of the day (motd)

  * Allows core dumps of subsidiary applications if desired

  * Cleaner execution of subsidiary shell (Jay Freeman)

  * Fix leaking utmp entries (Ed Schouten)

  * Add support for Cygwin (Joshua Pollack)

  * Add support for RHEL/CentOS 5 (Reini Urban)

  * Use less CPU when server's network is down

  * Disable posterization of 256colors to 8 ANSI colors

 -- Keith Winstein <keithw@mit.edu>  Mon, 16 Apr 2012 21:16:28 -0400

mosh (1.1.3a-1) unstable; urgency=low

  * Support 16-color escape sequences (Anders Kaseorg)

  * Fix some wraparound glitches

  * Fix escape sequences when server run on BSD and OS X (Peter Jeremy)

  * FreeBSD support (Ben Kaduk)

  * Fixes to build on iOS (Peter Iannucci)

  * Add some tests (Keegan McAllister)

  * Support OS X iTerm with lowercase "utf-8"

  * Avoid unnecessary link with -lncurses when possible (Anders Kaseorg)

 -- Keith Winstein <keithw@mit.edu>  Wed, 11 Apr 2012 03:36:49 -0400

mosh (1.1.3-1) unstable; urgency=low

  * Version 1.1.3 released.

 -- Keith Winstein <keithw@mit.edu>  Tue, 03 Apr 2012 12:33:46 -0400

mosh (1.1.2c-1) unstable; urgency=low

  * Fix bug causing occasional missing (or spurious) wraparound copy-and-paste

 -- Keith Winstein <keithw@mit.edu>  Mon, 02 Apr 2012 19:08:19 -0400

mosh (1.1.2b-1) unstable; urgency=low

  * Close connection after four petabytes (per OCB recommendation)

 -- Keith Winstein <keithw@mit.edu>  Sat, 31 Mar 2012 17:25:10 -0400

mosh (1.1.2a-1) unstable; urgency=low

  * Fixes to build on armel and armhf (Keegan McAllister)

  * Fix to build on FreeBSD, with warning about broken tty multibyte delete (reported by Christoph Egger)

  * Keep sane values in unused wx_xpixel/wx_ypixel values of struct winsize.

 -- Keith Winstein <keithw@mit.edu>  Sat, 31 Mar 2012 15:51:31 -0400

mosh (1.1.2-1) unstable; urgency=low

  * Version 1.1.2 released.

 -- Keith Winstein <keithw@mit.edu>  Wed, 28 Mar 2012 18:02:28 +0200

mosh (1.1.1a-1) unstable; urgency=low

  * Fixes to build on OS X 10.5 with older gcc and -lpoll (Quentin Smith)

  * Add --with-utempter and --without-utempter per gentoo req (Michael Weber)

  * configure now requires ncurses headers (and others) to be installed

  * Consolidate locale routines to help Android port (Keegan McAllister)

 -- Keith Winstein <keithw@mit.edu>  Wed, 28 Mar 2012 15:16:51 +0200

mosh (1.1.1-1) unstable; urgency=low

  * Version 1.1.1 released.

  * Fix spec file and build failure on Fedora.

  * Print out error message properly on fatal_assert().

  * Support for machines without posix_memalign().

 -- Keith Winstein <keithw@mit.edu>  Tue, 27 Mar 2012 01:18:26 +0200

mosh (1.1-1) unstable; urgency=low

  * Version 1.1 released

 -- Keith Winstein <keithw@mit.edu>  Thu, 22 Mar 2012 18:40:59 -0400

mosh (1.0.9d-1) unstable; urgency=low

  * Fix bug preventing -p argument from working

 -- Keith Winstein <keithw@mit.edu>  Wed, 21 Mar 2012 22:46:51 -0400

mosh (1.0.9c-1) unstable; urgency=low

  * Improved building on Mac OS X (Anders Kaseorg)

  * PRNG (for chaff) now reads from /dev/urandom (Keegan McAllister)

  * Startup script cleanups and fix shell quoting (Anders Kaseorg)

  * Disables core dumps (containing session key) (Keegan McAllister)

  * Improved terminal shutdown and other cosmetic fixes

 -- Keith Winstein <keithw@mit.edu>  Wed, 21 Mar 2012 19:23:41 -0400

mosh (1.0.9b-1) unstable; urgency=low

  * More efficient repaint when scrolling top part of window

 -- Keith Winstein <keithw@mit.edu>  Sun, 18 Mar 2012 16:37:30 -0400

mosh (1.0.9a-1) unstable; urgency=low

  * Add chaff to datagrams to frustrate statistical analysis of length

 -- Keith Winstein <keithw@mit.edu>  Sun, 18 Mar 2012 14:00:11 -0400

mosh (1.0.9-1) unstable; urgency=low

  * Release candidate for version 1.1.

  * Allows user to specify remote command to execute.

  * Only advertises 256 colors when user's terminal has 256 colors.

 -- Keith Winstein <keithw@mit.edu>  Sun, 18 Mar 2012 06:06:43 -0400

mosh (1.0.2-1) unstable; urgency=low

  * Version 1.02 released.

  * Uses xterm-256color and supports 256-color escape sequences.

  * Posterizes to 8 colors unless the user has a 256-color terminal.

  * Handles terminals without BCE.

  * Starts login shell.

 -- Keith Winstein <keithw@mit.edu>  Fri, 16 Mar 2012 17:57:45 -0400

mosh (1.0.1-1) unstable; urgency=low

  * Version 1.01 released.

  * Roughly 40% less CPU usage.

 -- Keith Winstein <keithw@mit.edu>  Wed, 14 Mar 2012 04:55:11 -0400

mosh (1.0-1) unstable; urgency=low

  * Version 1.0 released.

  * mosh now supports --version option and prints no-warranty message.

 -- Keith Winstein <keithw@mit.edu>  Mon, 12 Mar 2012 04:51:43 -0400

mosh (0.98c-1) unstable; urgency=low

  * Fix pointer comparison (Anders Kaseorg)

 -- Keith Winstein <keithw@mit.edu>  Sat, 10 Mar 2012 16:50:35 -0500

mosh (0.98b-1) unstable; urgency=low

  * Update README.md

 -- Keith Winstein <keithw@mit.edu>  Sat, 10 Mar 2012 14:05:12 -0500

mosh (0.98a-1) unstable; urgency=low

  * Small cleanup to generated terminal output when predictions active

 -- Keith Winstein <keithw@mit.edu>  Sat, 10 Mar 2012 06:40:24 -0500

mosh (0.98-1) unstable; urgency=low

  * Version 0.98 released.

  * Add option to select server-side UDP port.

  * Restrict default UDP port range to 60000..61000.

  * Use TERM / terminfo to decide when to send ECH sequence.

  * Now works properly inside tmux.

 -- Keith Winstein <keithw@mit.edu>  Sat, 10 Mar 2012 05:45:34 -0500

mosh (0.97-1) unstable; urgency=low

  * Merged Mac OS X port (thanks to Quentin Smith and Anders Kaseorg)

  * Server will quit if no connection within first 60 seconds

  * Startup script no longer requires threaded Perl

  * Add --enable-compile-warnings=error to ./configure

  * Fix some flicker issues with adaptive prediction mode

 -- Keith Winstein <keithw@mit.edu>  Wed, 07 Mar 2012 04:17:19 -0500

mosh (0.96a-3) unstable; urgency=low

  * Update copyright file to correct pkg.m4 is GPL-2+ not GPL-2

 -- Keith Winstein <keithw@mit.edu>  Sat, 03 Mar 2012 19:06:43 -0500

mosh (0.96a-2) unstable; urgency=low

  * Update copyright file to include public domain files and other licenses

 -- Keith Winstein <keithw@mit.edu>  Sat, 03 Mar 2012 14:05:15 -0500

mosh (0.96a-1) unstable; urgency=low

  * Version 0.96a released.

  * Fix build problem on i386

 -- Keith Winstein <keithw@mit.edu>  Sun, 26 Feb 2012 13:49:44 -0500

mosh (0.96-1) unstable; urgency=low

  * Version 0.96 released.

  * Compress all instructions with zlib

 -- Keith Winstein <keithw@mit.edu>  Sun, 26 Feb 2012 04:40:46 -0500

mosh (0.95-1) unstable; urgency=low

  * Version 0.95 released.

  * Make echo acknowledgment reliable to reduce spurious mispredict detections.

  * Require two dropped heartbeats before showing blue bar of lost contact

  * Print newline before MOSH CONNECT string to make more robust

  * Disable ControlMaster in initial SSH connection so proxy is always used

  * Make retransmissions occur at frame rate for limited time after loss

 -- Keith Winstein <keithw@mit.edu>  Sat, 25 Feb 2012 15:15:59 -0500

mosh (0.94c-1) unstable; urgency=low

  * Move to protobuf (from protobuf-lite) to make build on Ubuntu 10.04

 -- Keith Winstein <keithw@mit.edu>  Mon, 20 Feb 2012 00:39:12 -0500

mosh (0.94b-1) unstable; urgency=low

  * Relax autoconf dependency

 -- Keith Winstein <keithw@mit.edu>  Sun, 19 Feb 2012 22:55:53 -0500

mosh (0.94a-1) unstable; urgency=low

  * Relax debhelper dependency to make build on Ubuntu 10.04 LTS lucid

 -- Keith Winstein <keithw@mit.edu>  Sun, 19 Feb 2012 22:03:03 -0500

mosh (0.94-1) unstable; urgency=low

  * Version 0.94 released.

  * Make man pages.

  * Replace C++11 features (lambda and auto) with boost equivalents
	        (Anders Kaseorg)

  * Now builds with g++ or clang (with libstdc++)

 -- Keith Winstein <keithw@mit.edu>  Wed, 15 Feb 2012 13:56:11 -0500

mosh (0.93-1) unstable; urgency=low

  * Version 0.93 released.

  * Make utmp entries.

 -- Keith Winstein <keithw@mit.edu>  Mon, 13 Feb 2012 05:44:35 -0500

mosh (0.92-1) unstable; urgency=low

  * Version 0.92 released.

  * Allows user to select prediction mode (always/never/adaptive)

  * Fix bug in server startup on slow hosts

  * Better prediction when deleting at line ending

 -- Keith Winstein <keithw@mit.edu>  Mon, 13 Feb 2012 03:53:31 -0500

mosh (0.91a-0ubuntu1) oneiric; urgency=low

  * Add missing dependencies to debian/control

 -- Keith Winstein <keithw@mit.edu>  Thu, 09 Feb 2012 09:34:18 -0500

mosh (0.91-0ubuntu1) oneiric; urgency=low

  * Version 0.91 released.

  * Startup script support SSH options and aliases (Anders Kaseorg)

  * End use of Path MTU discovery and allow IP fragmentation because,
    e.g., Cisco VPN has MTU of 1200 and does not pass ICMP too-big.

  * Better exception and error handling.

  * Restrict predictive local echo display to long-delay links
    (>60 ms RTT) or for temporarily after a "glitch." Otherwise simply
    show server echos, while maintaining prediction overlay in the
    background in case it is needed.

 -- Keith Winstein <keithw@mit.edu>  Thu, 09 Feb 2012 03:05:45 -0500

mosh (0.9b-0ubuntu1) oneiric; urgency=low

  * Merged Anders Kaseorg fixes to build system

 -- Keith Winstein <keithw@mit.edu>  Tue, 07 Feb 2012 17:27:42 -0500

mosh (0.9a-0ubuntu1) oneiric; urgency=low

  * Edit README

 -- Keith Winstein <keithw@mit.edu>  Sun, 05 Feb 2012 03:50:53 -0500

mosh (0.9-0ubuntu1) oneiric; urgency=low

  * Initial release

 -- Keith Winstein <keithw@mit.edu>  Sun, 05 Feb 2012 03:50:53 -0500


================================================
FILE: debian/control
================================================
Source: mosh
Section: net
Priority: optional
Maintainer: Keith Winstein <keithw@mit.edu>
Uploaders: Alex Chernyakhovsky <achernya@debian.org>
Build-Depends: debhelper-compat (= 12), protobuf-compiler, libprotobuf-dev, pkg-config, libutempter-dev, zlib1g-dev, libncurses5-dev, libssl-dev, bash-completion, locales <!nocheck>, tmux <!nocheck>, less <!nocheck>
Rules-Requires-Root: binary-targets
Standards-Version: 4.6.1
Homepage: https://mosh.org
Vcs-Git: https://github.com/mobile-shell/mosh.git
Vcs-Browser: https://github.com/mobile-shell/mosh

Package: mosh
Architecture: any
Pre-Depends: dpkg (>= 1.15.7.2)
Depends: ${shlibs:Depends}, ${misc:Depends}, openssh-client
Recommends: libio-socket-ip-perl
Description: Mobile shell that supports roaming and intelligent local echo
 Mosh is a remote terminal application that supports:
   - intermittent network connectivity,
   - roaming to different IP address without dropping the connection, and
   - intelligent local echo and line editing to reduce the effects
     of "network lag" on high-latency connections.


================================================
FILE: debian/copyright
================================================
Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: mosh
Source: https://github.com/mobile-shell/mosh

Files: *
Copyright: 2012 Keith Winstein <mosh-devel@mit.edu>
License: GPL-3+ with OpenSSL exception
 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/>.
 .
 In addition, as a special exception, the copyright holders give
 permission to link the code of portions of this program with the
 OpenSSL library under certain conditions as described in each
 individual source file, and distribute linked combinations including
 the two.
 .
 You must obey the GNU General Public License in all respects for all
 of the code used other than OpenSSL. If you modify file(s) with this
 exception, you may extend this exception to your version of the
 file(s), but you are not obligated to do so. If you do not wish to do
 so, delete this exception statement from your version. If you delete
 this exception statement from all source files in the program, then
 also delete it here.
 .
 On Debian systems, the complete text of the GNU General
 Public License version 3 can be found in "/usr/share/common-licenses/GPL-3".

Files: m4/pkg.m4
Copyright: 2004 Scott James Remnant <scott@netsplit.com>
License: GPL-2+
 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 2 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/>.
 .
 As a special exception to the GNU General Public License, if you
 distribute this file as part of a program that contains a
 configuration script generated by Autoconf, you may include it under
 the same distribution terms that you use for the rest of that program.
 .
 On Debian systems, the complete text of the GNU General
 Public License version 2 can be found in "/usr/share/common-licenses/GPL-2"

Files: m4/ax_check_library.m4
Copyright: 2010 Diego Elio Petteno` <flameeyes@gmail.com>
License: GPL-3+ with Autoconf exception

Files: m4/ax_check_compile_flag.m4 m4/ax_check_link_flag.m4
Copyright: 2008 Guido U. Draheim <guidod@gmx.de>
           2011 Maarten Bosmans <mkbosmans@gmail.com>
License: GPL-3+ with Autoconf exception

License: GPL-3+ with Autoconf exception
 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/>.
 .
 As a special exception, the respective Autoconf Macro's copyright owner
 gives unlimited permission to copy, distribute and modify the configure
 scripts that are the output of Autoconf when processing the Macro. You
 need not follow the terms of the GNU General Public License when using
 or distributing such scripts, even though portions of the text of the
 Macro appear in them. The GNU General Public License (GPL) does govern
 all other use of the material that constitutes the Autoconf Macro.
 .
 This special exception to the GPL applies to versions of the Autoconf
 Macro released by the Autoconf Archive. When you make and distribute a
 modified version of the Autoconf Macro, you may extend this special
 exception to the GPL to apply to your modified version as well.
 .
 On Debian systems, the complete text of the GNU General
 Public License version 3 can be found in "/usr/share/common-licenses/GPL-3".

Files: src/crypto/ocb_internal.cc src/crypto/ocb_openssl.cc
Copyright: 2011 Ted Krovetz
           2022 Google LLC
License: ISC
 Permission to use, copy, modify, and/or distribute this software for any
 purpose with or without fee is hereby granted, provided that the above
 copyright notice and this permission notice appear in all copies.
 .
 THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
 WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
 MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
 ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
 WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
 ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
 OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 .
 Phillip Rogaway holds patents relevant to OCB. See the following for
 his patent grant: http://www.cs.ucdavis.edu/~rogaway/ocb/grant.htm
 (also found in ocb-license.html in the Mosh source distribution).

Files: src/crypto/ae.h
Copyright: none
License: public-domain
 This file is in the public domain. It is provided "as is", without
 warranty of any kind. Use at your own risk.
 .
 Comments are welcome: Ted Krovetz <ted@krovetz>.


================================================
FILE: debian/docs
================================================
README.md


================================================
FILE: debian/mosh.maintscript
================================================
rm_conffile /etc/bash_completion.d/mosh 1.2.5~


================================================
FILE: debian/rules
================================================
#!/usr/bin/make -f
# -*- makefile -*-
# Sample debian/rules that uses debhelper.
# This file was originally written by Joey Hess and Craig Small.
# As a special exception, when this file is copied by dh-make into a
# dh-make output file, you may use that output file without restriction.
# This special exception was added by Craig Small in version 0.37 of dh-make.

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

# Through Autoconf we set hardening flags that are actually more aggressive
# than the Ubuntu defaults, but they conflict with same.
export DEB_BUILD_MAINT_OPTIONS = hardening=-stackprotector
-include /usr/share/dpkg/buildflags.mk

%:
	dh $@ --with autoreconf

override_dh_auto_configure:
	dh_auto_configure -- \
		--disable-silent-rules \
		--enable-ufw \
		--enable-completion \
		--enable-compile-warnings=error

override_dh_perl:
	# mosh only uses Perl modules in perl-base.
	dh_perl -d


================================================
FILE: debian/source/format
================================================
3.0 (quilt)


================================================
FILE: debian/watch
================================================
version=4
opts="filenamemangle=s%(?:.*?)?v?(\d[\d.]*)\.tar\.gz%@PACKAGE@-$1.tar.gz%" \
    https://github.com/mobile-shell/mosh/tags \
    .*/mosh-(\d[\d\.]+)\.tar\.gz debian uupdate


================================================
FILE: fedora/mosh.spec
================================================
Name:		mosh
Version:	1.2.5
Release:	1%{?dist}
Summary:	Mobile shell that supports roaming and intelligent local echo

License:	GPLv3+
Group:		Applications/Internet
URL:		https://mosh.org/
Source0:	https://github.com/downloads/keithw/mosh/mosh-%{version}.tar.gz

BuildRequires:	protobuf-compiler
BuildRequires:	protobuf-devel
BuildRequires:	libutempter-devel
BuildRequires:	zlib-devel
BuildRequires:	ncurses-devel
BuildRequires:	openssl-devel
Requires:	openssh-clients
Requires:	openssl
Requires:	perl-IO-Socket-IP

%description
Mosh is a remote terminal application that supports:
  - intermittent network connectivity,
  - roaming to different IP address without dropping the connection, and
  - intelligent local echo and line editing to reduce the effects
    of "network lag" on high-latency connections.


%prep
%setup -q


%build
# Use upstream's more aggressive hardening instead of Fedora's defaults
export CFLAGS="-g -O2" CXXFLAGS="-g -O2"
%configure --enable-compile-warnings=error
make %{?_smp_mflags}


%install
make install DESTDIR=$RPM_BUILD_ROOT


%files
%doc README.md COPYING ChangeLog
%{_bindir}/mosh
%{_bindir}/mosh-client
%{_bindir}/mosh-server
%{_mandir}/man1/mosh.1.gz
%{_mandir}/man1/mosh-client.1.gz
%{_mandir}/man1/mosh-server.1.gz


%changelog
* Sun Jul 12 2015 John Hood <cgull@glup.org> - 1.2.5-1
- Update to mosh 1.2.5

* Fri Jun 26 2015 John Hood <cgull@glup.org> - 1.2.4.95rc2-1
- Update to mosh 1.2.4.95rc2

* Mon Jun 08 2015 John Hood <cgull@glup.org> - 1.2.4.95rc1-1
- Update to mosh 1.2.4.95rc1

* Wed Mar 27 2013 Alexander Chernyakhovsky <achernya@mit.edu> - 1.2.4-1
- Update to mosh 1.2.4

* Sun Mar 10 2013 Alexander Chernyakhovsky <achernya@mit.edu> - 1.2.3-3
- Rebuilt for Protobuf API change from 2.4.1 to 2.5.0

* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.2.3-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild

* Fri Oct 19 2012 Alexander Chernyakhovsky <achernya@mit.edu> - 1.2.3-1
- Update to mosh 1.2.3

* Fri Jul 20 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.2.2-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild

* Wed Jun 13 2012 Alexander Chernyakhovsky <achernya@mit.edu> - 1.2.2-1
- Update to mosh 1.2.2

* Sat Apr 28 2012 Alexander Chernyakhovsky <achernya@mit.edu> - 1.2-2
- Add -g and -O2 CFLAGS

* Fri Apr 27 2012 Alexander Chernyakhovsky <achernya@mit.edu> - 1.2-1
- Update to mosh 1.2.

* Mon Mar 26 2012 Alexander Chernyakhovsky <achernya@mit.edu> - 1.1.1-1
- Update to mosh 1.1.1.

* Wed Mar 21 2012 Alexander Chernyakhovsky <achernya@mit.edu> - 1.1-1
- Initial packaging for mosh.


================================================
FILE: m4/ax_ac_append_to_file.m4
================================================
# ===========================================================================
#   https://www.gnu.org/software/autoconf-archive/ax_ac_append_to_file.html
# ===========================================================================
#
# SYNOPSIS
#
#   AX_AC_APPEND_TO_FILE([FILE],[DATA])
#
# DESCRIPTION
#
#   Appends the specified data to the specified Autoconf is run. If you want
#   to append to a file when configure is run use AX_APPEND_TO_FILE instead.
#
# LICENSE
#
#   Copyright (c) 2009 Allan Caffee <allan.caffee@gmail.com>
#
#   Copying and distribution of this file, with or without modification, are
#   permitted in any medium without royalty provided the copyright notice
#   and this notice are preserved. This file is offered as-is, without any
#   warranty.

#serial 10

AC_DEFUN([AX_AC_APPEND_TO_FILE],[
AC_REQUIRE([AX_FILE_ESCAPES])
m4_esyscmd(
AX_FILE_ESCAPES
[
printf "%s" "$2" >> "$1"
])
])


================================================
FILE: m4/ax_ac_print_to_file.m4
================================================
# ===========================================================================
#   https://www.gnu.org/software/autoconf-archive/ax_ac_print_to_file.html
# ===========================================================================
#
# SYNOPSIS
#
#   AX_AC_PRINT_TO_FILE([FILE],[DATA])
#
# DESCRIPTION
#
#   Writes the specified data to the specified file when Autoconf is run. If
#   you want to print to a file when configure is run use AX_PRINT_TO_FILE
#   instead.
#
# LICENSE
#
#   Copyright (c) 2009 Allan Caffee <allan.caffee@gmail.com>
#
#   Copying and distribution of this file, with or without modification, are
#   permitted in any medium without royalty provided the copyright notice
#   and this notice are preserved. This file is offered as-is, without any
#   warranty.

#serial 10

AC_DEFUN([AX_AC_PRINT_TO_FILE],[
m4_esyscmd(
AC_REQUIRE([AX_FILE_ESCAPES])
[
printf "%s" "$2" > "$1"
])
])


================================================
FILE: m4/ax_add_am_macro_static.m4
================================================
# ===========================================================================
#  https://www.gnu.org/software/autoconf-archive/ax_add_am_macro_static.html
# ===========================================================================
#
# SYNOPSIS
#
#   AX_ADD_AM_MACRO_STATIC([RULE])
#
# DESCRIPTION
#
#   Adds the specified rule to $AMINCLUDE.
#
# LICENSE
#
#   Copyright (c) 2009 Tom Howard <tomhoward@users.sf.net>
#   Copyright (c) 2009 Allan Caffee <allan.caffee@gmail.com>
#
#   Copying and distribution of this file, with or without modification, are
#   permitted in any medium without royalty provided the copyright notice
#   and this notice are preserved. This file is offered as-is, without any
#   warranty.

#serial 8

AC_DEFUN([AX_ADD_AM_MACRO_STATIC],[
  AC_REQUIRE([AX_AM_MACROS_STATIC])
  AX_AC_APPEND_TO_FILE(AMINCLUDE_STATIC,[$1])
])


================================================
FILE: m4/ax_am_macros_static.m4
================================================
# ===========================================================================
#   https://www.gnu.org/software/autoconf-archive/ax_am_macros_static.html
# ===========================================================================
#
# SYNOPSIS
#
#   AX_AM_MACROS_STATIC
#
# DESCRIPTION
#
#   Adds support for macros that create Automake rules. You must manually
#   add the following line
#
#     include $(top_srcdir)/aminclude_static.am
#
#   to your Makefile.am files.
#
# LICENSE
#
#   Copyright (c) 2009 Tom Howard <tomhoward@users.sf.net>
#   Copyright (c) 2009 Allan Caffee <allan.caffee@gmail.com>
#
#   Copying and distribution of this file, with or without modification, are
#   permitted in any medium without royalty provided the copyright notice
#   and this notice are preserved. This file is offered as-is, without any
#   warranty.

#serial 11

AC_DEFUN([AMINCLUDE_STATIC],[aminclude_static.am])

AC_DEFUN([AX_AM_MACROS_STATIC],
[
AX_AC_PRINT_TO_FILE(AMINCLUDE_STATIC,[
# ]AMINCLUDE_STATIC[ generated automatically by Autoconf
# from AX_AM_MACROS_STATIC on ]m4_esyscmd([LC_ALL=C date])[
])
])


================================================
FILE: m4/ax_check_compile_flag.m4
================================================
# ===========================================================================
#   http://www.gnu.org/software/autoconf-archive/ax_check_compile_flag.html
# ===========================================================================
#
# SYNOPSIS
#
#   AX_CHECK_COMPILE_FLAG(FLAG, [ACTION-SUCCESS], [ACTION-FAILURE], [EXTRA-FLAGS])
#
# DESCRIPTION
#
#   Check whether the given FLAG works with the current language's compiler
#   or gives an error.  (Warnings, however, are ignored)
#
#   ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on
#   success/failure.
#
#   If EXTRA-FLAGS is defined, it is added to the current language's default
#   flags (e.g. CFLAGS) when the check is done.  The check is thus made with
#   the flags: "CFLAGS EXTRA-FLAGS FLAG".  This can for example be used to
#   force the compiler to issue an error when a bad flag is given.
#
#   NOTE: Implementation based on AX_CFLAGS_GCC_OPTION. Please keep this
#   macro in sync with AX_CHECK_{PREPROC,LINK}_FLAG.
#
# LICENSE
#
#   Copyright (c) 2008 Guido U. Draheim <guidod@gmx.de>
#   Copyright (c) 2011 Maarten Bosmans <mkbosmans@gmail.com>
#
#   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/>.
#
#   As a special exception, the respective Autoconf Macro's copyright owner
#   gives unlimited permission to copy, distribute and modify the configure
#   scripts that are the output of Autoconf when processing the Macro. You
#   need not follow the terms of the GNU General Public License when using
#   or distributing such scripts, even though portions of the text of the
#   Macro appear in them. The GNU General Public License (GPL) does govern
#   all other use of the material that constitutes the Autoconf Macro.
#
#   This special exception to the GPL applies to versions of the Autoconf
#   Macro released by the Autoconf Archive. When you make and distribute a
#   modified version of the Autoconf Macro, you may extend this special
#   exception to the GPL to apply to your modified version as well.

#serial 2

AC_DEFUN([AX_CHECK_COMPILE_FLAG],
[AC_PREREQ(2.59)dnl for _AC_LANG_PREFIX
AS_VAR_PUSHDEF([CACHEVAR],[ax_cv_check_[]_AC_LANG_ABBREV[]flags_$4_$1])dnl
AC_CACHE_CHECK([whether _AC_LANG compiler accepts $1], CACHEVAR, [
  ax_check_save_flags=$[]_AC_LANG_PREFIX[]FLAGS
  _AC_LANG_PREFIX[]FLAGS="$[]_AC_LANG_PREFIX[]FLAGS $4 $1"
  AC_COMPILE_IFELSE([AC_LANG_PROGRAM()],
    [AS_VAR_SET(CACHEVAR,[yes])],
    [AS_VAR_SET(CACHEVAR,[no])])
  _AC_LANG_PREFIX[]FLAGS=$ax_check_save_flags])
AS_IF([test x"AS_VAR_GET(CACHEVAR)" = xyes],
  [m4_default([$2], :)],
  [m4_default([$3], :)])
AS_VAR_POPDEF([CACHEVAR])dnl
])dnl AX_CHECK_COMPILE_FLAGS


================================================
FILE: m4/ax_check_gnu_make.m4
================================================
# ===========================================================================
#    https://www.gnu.org/software/autoconf-archive/ax_check_gnu_make.html
# ===========================================================================
#
# SYNOPSIS
#
#   AX_CHECK_GNU_MAKE([run-if-true],[run-if-false])
#
# DESCRIPTION
#
#   This macro searches for a GNU version of make. If a match is found:
#
#     * The makefile variable `ifGNUmake' is set to the empty string, otherwise
#       it is set to "#". This is useful for including a special features in a
#       Makefile, which cannot be handled by other versions of make.
#     * The makefile variable `ifnGNUmake' is set to #, otherwise
#       it is set to the empty string. This is useful for including a special
#       features in a Makefile, which can be handled
#       by other versions of make or to specify else like clause.
#     * The variable `_cv_gnu_make_command` is set to the command to invoke
#       GNU make if it exists, the empty string otherwise.
#     * The variable `ax_cv_gnu_make_command` is set to the command to invoke
#       GNU make by copying `_cv_gnu_make_command`, otherwise it is unset.
#     * If GNU Make is found, its version is extracted from the output of
#       `make --version` as the last field of a record of space-separated
#       columns and saved into the variable `ax_check_gnu_make_version`.
#     * Additionally if GNU Make is found, run shell code run-if-true
#       else run shell code run-if-false.
#
#   Here is an example of its use:
#
#   Makefile.in might contain:
#
#     # A failsafe way of putting a dependency rule into a makefile
#     $(DEPEND):
#             $(CC) -MM $(srcdir)/*.c > $(DEPEND)
#
#     @ifGNUmake@ ifeq ($(DEPEND),$(wildcard $(DEPEND)))
#     @ifGNUmake@ include $(DEPEND)
#     @ifGNUmake@ else
#     fallback code
#     @ifGNUmake@ endif
#
#   Then configure.in would normally contain:
#
#     AX_CHECK_GNU_MAKE()
#     AC_OUTPUT(Makefile)
#
#   Then perhaps to cause gnu make to override any other make, we could do
#   something like this (note that GNU make always looks for GNUmakefile
#   first):
#
#     if  ! test x$_cv_gnu_make_command = x ; then
#             mv Makefile GNUmakefile
#             echo .DEFAULT: > Makefile ;
#             echo \  $_cv_gnu_make_command \$@ >> Makefile;
#     fi
#
#   Then, if any (well almost any) other make is called, and GNU make also
#   exists, then the other make wraps the GNU make.
#
# LICENSE
#
#   Copyright (c) 2008 John Darrington <j.darrington@elvis.murdoch.edu.au>
#   Copyright (c) 2015 Enrico M. Crisostomo <enrico.m.crisostomo@gmail.com>
#
#   Copying and distribution of this file, with or without modification, are
#   permitted in any medium without royalty provided the copyright notice
#   and this notice are preserved. This file is offered as-is, without any
#   warranty.

#serial 12

AC_DEFUN([AX_CHECK_GNU_MAKE],dnl
  [AC_PROG_AWK
  AC_CACHE_CHECK([for GNU make],[_cv_gnu_make_command],[dnl
    _cv_gnu_make_command="" ;
dnl Search all the common names for GNU make
    for a in "$MAKE" make gmake gnumake ; do
      if test -z "$a" ; then continue ; fi ;
      if "$a" --version 2> /dev/null | grep GNU 2>&1 > /dev/null ; then
        _cv_gnu_make_command=$a ;
        AX_CHECK_GNU_MAKE_HEADLINE=$("$a" --version 2> /dev/null | grep "GNU Make")
        ax_check_gnu_make_version=$(echo ${AX_CHECK_GNU_MAKE_HEADLINE} | ${AWK} -F " " '{ print $(NF); }')
        break ;
      fi
    done ;])
dnl If there was a GNU version, then set @ifGNUmake@ to the empty string, '#' otherwise
  AS_VAR_IF([_cv_gnu_make_command], [""], [AS_VAR_SET([ifGNUmake], ["#"])],   [AS_VAR_SET([ifGNUmake], [""])])
  AS_VAR_IF([_cv_gnu_make_command], [""], [AS_VAR_SET([ifnGNUmake], [""])],   [AS_VAR_SET([ifnGNUmake], ["#"])])
  AS_VAR_IF([_cv_gnu_make_command], [""], [AS_UNSET(ax_cv_gnu_make_command)], [AS_VAR_SET([ax_cv_gnu_make_command], [${_cv_gnu_make_command}])])
  AS_VAR_IF([_cv_gnu_make_command], [""],[$2],[$1])
  AC_SUBST([ifGNUmake])
  AC_SUBST([ifnGNUmake])
])


================================================
FILE: m4/ax_check_library.m4
================================================
# ===========================================================================
#     http://www.gnu.org/software/autoconf-archive/ax_check_library.html
# ===========================================================================
#
# SYNOPSIS
#
#   AX_CHECK_LIBRARY(VARIABLE-PREFIX, HEADER-FILE, LIBRARY-FILE,
#                    [ACTION-IF-FOUND], [ACTION-IF-NOT_FOUND])
#
# DESCRIPTION
#
#   Provides a generic test for a given library, similar in concept to the
#   PKG_CHECK_MODULES macro used by pkg-config.
#
#   Most simplest libraries can be checked against simply through the
#   presence of a header file and a library to link to. This macro allows to
#   wrap around the test so that it doesn't have to be recreated each time.
#
#   Rather than define --with-$LIBRARY arguments, it uses variables in the
#   same way that PKG_CHECK_MODULES does. It doesn't, though, use the same
#   names, since you shouldn't provide a value for LIBS or CFLAGS but rather
#   for LDFLAGS and CPPFLAGS, to tell the linker and compiler where to find
#   libraries and headers respectively.
#
#   If the library is find, HAVE_PREFIX is defined, and in all cases
#   PREFIX_LDFLAGS and PREFIX_CPPFLAGS are substituted.
#
#   Example:
#
#     AX_CHECK_LIBRARY([LIBEVENT], [event.h], [event], [],
#                      [AC_MSG_ERROR([Unable to find libevent])])
#
# LICENSE
#
#   Copyright (c) 2010 Diego Elio Petteno` <flameeyes@gmail.com>
#
#   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/>.
#
#   As a special exception, the respective Autoconf Macro's copyright owner
#   gives unlimited permission to copy, distribute and modify the configure
#   scripts that are the output of Autoconf when processing the Macro. You
#   need not follow the terms of the GNU General Public License when using
#   or distributing such scripts, even though portions of the text of the
#   Macro appear in them. The GNU General Public License (GPL) does govern
#   all other use of the material that constitutes the Autoconf Macro.
#
#   This special exception to the GPL applies to versions of the Autoconf
#   Macro released by the Autoconf Archive. When you make and distribute a
#   modified version of the Autoconf Macro, you may extend this special
#   exception to the GPL to apply to your modified version as well.

#serial 4

AC_DEFUN([AX_CHECK_LIBRARY], [
  AC_ARG_VAR($1[_CPPFLAGS], [C preprocessor flags for ]$1[ headers])
  AC_ARG_VAR($1[_LDFLAGS], [linker flags for ]$1[ libraries])

  AC_CACHE_VAL(AS_TR_SH([ax_cv_have_]$1),
    [save_CPPFLAGS="$CPPFLAGS"
     save_LDFLAGS="$LDFLAGS"
     save_LIBS="$LIBS"

     AS_IF([test "x$]$1[_CPPFLAGS" != "x"],
       [CPPFLAGS="$CPPFLAGS $]$1[_CPPFLAGS"])

     AS_IF([test "x$]$1[_LDFLAGS" != "x"],
       [LDFLAGS="$LDFLAGS $]$1[_LDFLAGS"])

     AC_CHECK_HEADER($2, [
       AC_CHECK_LIB($3, [main],
         [AS_TR_SH([ax_cv_have_]$1)=yes],
         [AS_TR_SH([ax_cv_have_]$1)=no])
     ], [AS_TR_SH([ax_cv_have_]$1)=no])

     CPPFLAGS="$save_CPPFLAGS"
     LDFLAGS="$save_LDFLAGS"
     LIBS="$save_LIBS"
    ])

  AS_IF([test "$]AS_TR_SH([ax_cv_have_]$1)[" = "yes"],
    AC_DEFINE([HAVE_]$1, [1], [Define to 1 if ]$1[ is found])
    [$4],
    [$5])
])


================================================
FILE: m4/ax_check_link_flag.m4
================================================
# ===========================================================================
#    http://www.gnu.org/software/autoconf-archive/ax_check_link_flag.html
# ===========================================================================
#
# SYNOPSIS
#
#   AX_CHECK_LINK_FLAG(FLAG, [ACTION-SUCCESS], [ACTION-FAILURE], [EXTRA-FLAGS])
#
# DESCRIPTION
#
#   Check whether the given FLAG works with the linker or gives an error.
#   (Warnings, however, are ignored)
#
#   ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on
#   success/failure.
#
#   If EXTRA-FLAGS is defined, it is added to the linker's default flags
#   when the check is done.  The check is thus made with the flags: "LDFLAGS
#   EXTRA-FLAGS FLAG".  This can for example be used to force the linker to
#   issue an error when a bad flag is given.
#
#   NOTE: Implementation based on AX_CFLAGS_GCC_OPTION. Please keep this
#   macro in sync with AX_CHECK_{PREPROC,COMPILE}_FLAG.
#
# LICENSE
#
#   Copyright (c) 2008 Guido U. Draheim <guidod@gmx.de>
#   Copyright (c) 2011 Maarten Bosmans <mkbosmans@gmail.com>
#
#   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/>.
#
#   As a special exception, the respective Autoconf Macro's copyright owner
#   gives unlimited permission to copy, distribute and modify the configure
#   scripts that are the output of Autoconf when processing the Macro. You
#   need not follow the terms of the GNU General Public License when using
#   or distributing such scripts, even though portions of the text of the
#   Macro appear in them. The GNU General Public License (GPL) does govern
#   all other use of the material that constitutes the Autoconf Macro.
#
#   This special exception to the GPL applies to versions of the Autoconf
#   Macro released by the Autoconf Archive. When you make and distribute a
#   modified version of the Autoconf Macro, you may extend this special
#   exception to the GPL to apply to your modified version as well.

#serial 2

AC_DEFUN([AX_CHECK_LINK_FLAG],
[AS_VAR_PUSHDEF([CACHEVAR],[ax_cv_check_ldflags_$4_$1])dnl
AC_CACHE_CHECK([whether the linker accepts $1], CACHEVAR, [
  ax_check_save_flags=$LDFLAGS
  LDFLAGS="$LDFLAGS $4 $1"
  AC_LINK_IFELSE([AC_LANG_PROGRAM()],
    [AS_VAR_SET(CACHEVAR,[yes])],
    [AS_VAR_SET(CACHEVAR,[no])])
  LDFLAGS=$ax_check_save_flags])
AS_IF([test x"AS_VAR_GET(CACHEVAR)" = xyes],
  [m4_default([$2], :)],
  [m4_default([$3], :)])
AS_VAR_POPDEF([CACHEVAR])dnl
])dnl AX_CHECK_LINK_FLAGS


================================================
FILE: m4/ax_code_coverage.m4
================================================
# ===========================================================================
#     https://www.gnu.org/software/autoconf-archive/ax_code_coverage.html
# ===========================================================================
#
# SYNOPSIS
#
#   AX_CODE_COVERAGE()
#
# DESCRIPTION
#
#   Defines CODE_COVERAGE_CPPFLAGS, CODE_COVERAGE_CFLAGS,
#   CODE_COVERAGE_CXXFLAGS and CODE_COVERAGE_LIBS which should be included
#   in the CPPFLAGS, CFLAGS CXXFLAGS and LIBS/LIBADD variables of every
#   build target (program or library) which should be built with code
#   coverage support. Also add rules using AX_ADD_AM_MACRO_STATIC; and
#   $enable_code_coverage which can be used in subsequent configure output.
#   CODE_COVERAGE_ENABLED is defined and substituted, and corresponds to the
#   value of the --enable-code-coverage option, which defaults to being
#   disabled.
#
#   Test also for gcov program and create GCOV variable that could be
#   substituted.
#
#   Note that all optimization flags in CFLAGS must be disabled when code
#   coverage is enabled.
#
#   Usage example:
#
#   configure.ac:
#
#     AX_CODE_COVERAGE
#
#   Makefile.am:
#
#     include $(top_srcdir)/aminclude_static.am
#
#     my_program_LIBS = ... $(CODE_COVERAGE_LIBS) ...
#     my_program_CPPFLAGS = ... $(CODE_COVERAGE_CPPFLAGS) ...
#     my_program_CFLAGS = ... $(CODE_COVERAGE_CFLAGS) ...
#     my_program_CXXFLAGS = ... $(CODE_COVERAGE_CXXFLAGS) ...
#
#     clean-local: code-coverage-clean
#     distclean-local: code-coverage-dist-clean
#
#   This results in a "check-code-coverage" rule being added to any
#   Makefile.am which do "include $(top_srcdir)/aminclude_static.am"
#   (assuming the module has been configured with --enable-code-coverage).
#   Running `make check-code-coverage` in that directory will run the
#   module's test suite (`make check`) and build a code coverage report
#   detailing the code which was touched, then print the URI for the report.
#
#   This code was derived from Makefile.decl in GLib, originally licensed
#   under LGPLv2.1+.
#
# LICENSE
#
#   Copyright (c) 2012, 2016 Philip Withnall
#   Copyright (c) 2012 Xan Lopez
#   Copyright (c) 2012 Christian Persch
#   Copyright (c) 2012 Paolo Borelli
#   Copyright (c) 2012 Dan Winship
#   Copyright (c) 2015,2018 Bastien ROUCARIES
#
#   This library is free software; you can redistribute it and/or modify it
#   under the terms of the GNU Lesser General Public License as published by
#   the Free Software Foundation; either version 2.1 of the License, or (at
#   your option) any later version.
#
#   This library 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 Lesser
#   General Public License for more details.
#
#   You should have received a copy of the GNU Lesser General Public License
#   along with this program. If not, see <https://www.gnu.org/licenses/>.

#serial 34

m4_define(_AX_CODE_COVERAGE_RULES,[
AX_ADD_AM_MACRO_STATIC([
# Code coverage
#
# Optional:
#  - CODE_COVERAGE_DIRECTORY: Top-level directory for code coverage reporting.
#    Multiple directories may be specified, separated by whitespace.
#    (Default: \$(top_builddir))
#  - CODE_COVERAGE_OUTPUT_FILE: Filename and path for the .info file generated
#    by lcov for code coverage. (Default:
#    \$(PACKAGE_NAME)-\$(PACKAGE_VERSION)-coverage.info)
#  - CODE_COVERAGE_OUTPUT_DIRECTORY: Directory for generated code coverage
#    reports to be created. (Default:
#    \$(PACKAGE_NAME)-\$(PACKAGE_VERSION)-coverage)
#  - CODE_COVERAGE_BRANCH_COVERAGE: Set to 1 to enforce branch coverage,
#    set to 0 to disable it and leave empty to stay with the default.
#    (Default: empty)
#  - CODE_COVERAGE_LCOV_SHOPTS_DEFAULT: Extra options shared between both lcov
#    instances. (Default: based on $CODE_COVERAGE_BRANCH_COVERAGE)
#  - CODE_COVERAGE_LCOV_SHOPTS: Extra options to shared between both lcov
#    instances. (Default: $CODE_COVERAGE_LCOV_SHOPTS_DEFAULT)
#  - CODE_COVERAGE_LCOV_OPTIONS_GCOVPATH: --gcov-tool pathtogcov
#  - CODE_COVERAGE_LCOV_OPTIONS_DEFAULT: Extra options to pass to the
#    collecting lcov instance. (Default: $CODE_COVERAGE_LCOV_OPTIONS_GCOVPATH)
#  - CODE_COVERAGE_LCOV_OPTIONS: Extra options to pass to the collecting lcov
#    instance. (Default: $CODE_COVERAGE_LCOV_OPTIONS_DEFAULT)
#  - CODE_COVERAGE_LCOV_RMOPTS_DEFAULT: Extra options to pass to the filtering
#    lcov instance. (Default: empty)
#  - CODE_COVERAGE_LCOV_RMOPTS: Extra options to pass to the filtering lcov
#    instance. (Default: $CODE_COVERAGE_LCOV_RMOPTS_DEFAULT)
#  - CODE_COVERAGE_GENHTML_OPTIONS_DEFAULT: Extra options to pass to the
#    genhtml instance. (Default: based on $CODE_COVERAGE_BRANCH_COVERAGE)
#  - CODE_COVERAGE_GENHTML_OPTIONS: Extra options to pass to the genhtml
#    instance. (Default: $CODE_COVERAGE_GENHTML_OPTIONS_DEFAULT)
#  - CODE_COVERAGE_IGNORE_PATTERN: Extra glob pattern of files to ignore
#
# The generated report will be titled using the \$(PACKAGE_NAME) and
# \$(PACKAGE_VERSION). In order to add the current git hash to the title,
# use the git-version-gen script, available online.
# Optional variables
# run only on top dir
if CODE_COVERAGE_ENABLED
 ifeq (\$(abs_builddir), \$(abs_top_builddir))
CODE_COVERAGE_DIRECTORY ?= \$(top_builddir)
CODE_COVERAGE_OUTPUT_FILE ?= \$(PACKAGE_NAME)-\$(PACKAGE_VERSION)-coverage.info
CODE_COVERAGE_OUTPUT_DIRECTORY ?= \$(PACKAGE_NAME)-\$(PACKAGE_VERSION)-coverage

CODE_COVERAGE_BRANCH_COVERAGE ?=
CODE_COVERAGE_LCOV_SHOPTS_DEFAULT ?= \$(if \$(CODE_COVERAGE_BRANCH_COVERAGE),\
--rc lcov_branch_coverage=\$(CODE_COVERAGE_BRANCH_COVERAGE))
CODE_COVERAGE_LCOV_SHOPTS ?= \$(CODE_COVERAGE_LCOV_SHOPTS_DEFAULT)
CODE_COVERAGE_LCOV_OPTIONS_GCOVPATH ?= --gcov-tool \"\$(GCOV)\"
CODE_COVERAGE_LCOV_OPTIONS_DEFAULT ?= \$(CODE_COVERAGE_LCOV_OPTIONS_GCOVPATH)
CODE_COVERAGE_LCOV_OPTIONS ?= \$(CODE_COVERAGE_LCOV_OPTIONS_DEFAULT)
CODE_COVERAGE_LCOV_RMOPTS_DEFAULT ?=
CODE_COVERAGE_LCOV_RMOPTS ?= \$(CODE_COVERAGE_LCOV_RMOPTS_DEFAULT)
CODE_COVERAGE_GENHTML_OPTIONS_DEFAULT ?=\
\$(if \$(CODE_COVERAGE_BRANCH_COVERAGE),\
--rc genhtml_branch_coverage=\$(CODE_COVERAGE_BRANCH_COVERAGE))
CODE_COVERAGE_GENHTML_OPTIONS ?= \$(CODE_COVERAGE_GENHTML_OPTIONS_DEFAULT)
CODE_COVERAGE_IGNORE_PATTERN ?=

GITIGNOREFILES := \$(GITIGNOREFILES) \$(CODE_COVERAGE_OUTPUT_FILE) \$(CODE_COVERAGE_OUTPUT_DIRECTORY)
code_coverage_v_lcov_cap = \$(code_coverage_v_lcov_cap_\$(V))
code_coverage_v_lcov_cap_ = \$(code_coverage_v_lcov_cap_\$(AM_DEFAULT_VERBOSITY))
code_coverage_v_lcov_cap_0 = @echo \"  LCOV   --capture\" \$(CODE_COVERAGE_OUTPUT_FILE);
code_coverage_v_lcov_ign = \$(code_coverage_v_lcov_ign_\$(V))
code_coverage_v_lcov_ign_ = \$(code_coverage_v_lcov_ign_\$(AM_DEFAULT_VERBOSITY))
code_coverage_v_lcov_ign_0 = @echo \"  LCOV   --remove /tmp/*\" \$(CODE_COVERAGE_IGNORE_PATTERN);
code_coverage_v_genhtml = \$(code_coverage_v_genhtml_\$(V))
code_coverage_v_genhtml_ = \$(code_coverage_v_genhtml_\$(AM_DEFAULT_VERBOSITY))
code_coverage_v_genhtml_0 = @echo \"  GEN   \" \"\$(CODE_COVERAGE_OUTPUT_DIRECTORY)\";
code_coverage_quiet = \$(code_coverage_quiet_\$(V))
code_coverage_quiet_ = \$(code_coverage_quiet_\$(AM_DEFAULT_VERBOSITY))
code_coverage_quiet_0 = --quiet

# sanitizes the test-name: replaces with underscores: dashes and dots
code_coverage_sanitize = \$(subst -,_,\$(subst .,_,\$(1)))

# Use recursive makes in order to ignore errors during check
check-code-coverage:
	-\$(AM_V_at)\$(MAKE) \$(AM_MAKEFLAGS) -k check
	\$(AM_V_at)\$(MAKE) \$(AM_MAKEFLAGS) code-coverage-capture

# Capture code coverage data
code-coverage-capture: code-coverage-capture-hook
	\$(code_coverage_v_lcov_cap)\$(LCOV) \$(code_coverage_quiet) \$(addprefix --directory ,\$(CODE_COVERAGE_DIRECTORY)) --capture --output-file \"\$(CODE_COVERAGE_OUTPUT_FILE).tmp\" --test-name \"\$(call code_coverage_sanitize,\$(PACKAGE_NAME)-\$(PACKAGE_VERSION))\" --no-checksum --compat-libtool \$(CODE_COVERAGE_LCOV_SHOPTS) \$(CODE_COVERAGE_LCOV_OPTIONS)
	\$(code_coverage_v_lcov_ign)\$(LCOV) \$(code_coverage_quiet) \$(addprefix --directory ,\$(CODE_COVERAGE_DIRECTORY)) --remove \"\$(CODE_COVERAGE_OUTPUT_FILE).tmp\" \"/tmp/*\" \$(CODE_COVERAGE_IGNORE_PATTERN) --output-file \"\$(CODE_COVERAGE_OUTPUT_FILE)\" \$(CODE_COVERAGE_LCOV_SHOPTS) \$(CODE_COVERAGE_LCOV_RMOPTS)
	-@rm -f \"\$(CODE_COVERAGE_OUTPUT_FILE).tmp\"
	\$(code_coverage_v_genhtml)LANG=C \$(GENHTML) \$(code_coverage_quiet) \$(addprefix --prefix ,\$(CODE_COVERAGE_DIRECTORY)) --output-directory \"\$(CODE_COVERAGE_OUTPUT_DIRECTORY)\" --title \"\$(PACKAGE_NAME)-\$(PACKAGE_VERSION) Code Coverage\" --legend --show-details \"\$(CODE_COVERAGE_OUTPUT_FILE)\" \$(CODE_COVERAGE_GENHTML_OPTIONS)
	@echo \"file://\$(abs_builddir)/\$(CODE_COVERAGE_OUTPUT_DIRECTORY)/index.html\"

code-coverage-clean:
	-\$(LCOV) --directory \$(top_builddir) -z
	-rm -rf \"\$(CODE_COVERAGE_OUTPUT_FILE)\" \"\$(CODE_COVERAGE_OUTPUT_FILE).tmp\" \"\$(CODE_COVERAGE_OUTPUT_DIRECTORY)\"
	-find . \\( -name \"*.gcda\" -o -name \"*.gcno\" -o -name \"*.gcov\" \\) -delete

code-coverage-dist-clean:

A][M_DISTCHECK_CONFIGURE_FLAGS := \$(A][M_DISTCHECK_CONFIGURE_FLAGS) --disable-code-coverage
 else # ifneq (\$(abs_builddir), \$(abs_top_builddir))
check-code-coverage:

code-coverage-capture: code-coverage-capture-hook

code-coverage-clean:

code-coverage-dist-clean:
 endif # ifeq (\$(abs_builddir), \$(abs_top_builddir))
else #! CODE_COVERAGE_ENABLED
# Use recursive makes in order to ignore errors during check
check-code-coverage:
	@echo \"Need to reconfigure with --enable-code-coverage\"
# Capture code coverage data
code-coverage-capture: code-coverage-capture-hook
	@echo \"Need to reconfigure with --enable-code-coverage\"

code-coverage-clean:

code-coverage-dist-clean:

endif #CODE_COVERAGE_ENABLED
# Hook rule executed before code-coverage-capture, overridable by the user
code-coverage-capture-hook:

.PHONY: check-code-coverage code-coverage-capture code-coverage-dist-clean code-coverage-clean code-coverage-capture-hook
])
])

AC_DEFUN([_AX_CODE_COVERAGE_ENABLED],[
	AX_CHECK_GNU_MAKE([],[AC_MSG_ERROR([not using GNU make that is needed for coverage])])
	AC_REQUIRE([AX_ADD_AM_MACRO_STATIC])
	# check for gcov
	AC_CHECK_TOOL([GCOV],
		  [$_AX_CODE_COVERAGE_GCOV_PROG_WITH],
		  [:])
	AS_IF([test "X$GCOV" = "X:"],
	      [AC_MSG_ERROR([gcov is needed to do coverage])])
	AC_SUBST([GCOV])

	dnl Check if gcc is being used
	AS_IF([ test "$GCC" = "no" ], [
		AC_MSG_ERROR([not compiling with gcc, which is required for gcov code coverage])
	      ])

	AC_CHECK_PROG([LCOV], [lcov], [lcov])
	AC_CHECK_PROG([GENHTML], [genhtml], [genhtml])

	AS_IF([ test x"$LCOV" = x ], [
		AC_MSG_ERROR([To enable code coverage reporting you must have lcov installed])
	      ])

	AS_IF([ test x"$GENHTML" = x ], [
		AC_MSG_ERROR([Could not find genhtml from the lcov package])
	])

	dnl Build the code coverage flags
	dnl Define CODE_COVERAGE_LDFLAGS for backwards compatibility
	CODE_COVERAGE_CPPFLAGS="-DNDEBUG"
	CODE_COVERAGE_CFLAGS="-O0 -g -fprofile-arcs -ftest-coverage"
	CODE_COVERAGE_CXXFLAGS="-O0 -g -fprofile-arcs -ftest-coverage"
	CODE_COVERAGE_LIBS="-lgcov"

	AC_SUBST([CODE_COVERAGE_CPPFLAGS])
	AC_SUBST([CODE_COVERAGE_CFLAGS])
	AC_SUBST([CODE_COVERAGE_CXXFLAGS])
	AC_SUBST([CODE_COVERAGE_LIBS])
])

AC_DEFUN([AX_CODE_COVERAGE],[
	dnl Check for --enable-code-coverage

	# allow to override gcov location
	AC_ARG_WITH([gcov],
	  [AS_HELP_STRING([--with-gcov[=GCOV]], [use given GCOV for coverage (GCOV=gcov).])],
	  [_AX_CODE_COVERAGE_GCOV_PROG_WITH=$with_gcov],
	  [_AX_CODE_COVERAGE_GCOV_PROG_WITH=gcov])

	AC_MSG_CHECKING([whether to build with code coverage support])
	AC_ARG_ENABLE([code-coverage],
	  AS_HELP_STRING([--enable-code-coverage],
	  [Whether to enable code coverage support]),,
	  enable_code_coverage=no)

	AM_CONDITIONAL([CODE_COVERAGE_ENABLED], [test "x$enable_code_coverage" = xyes])
	AC_SUBST([CODE_COVERAGE_ENABLED], [$enable_code_coverage])
	AC_MSG_RESULT($enable_code_coverage)

	AS_IF([ test "x$enable_code_coverage" = xyes ], [
		_AX_CODE_COVERAGE_ENABLED
	      ])

	_AX_CODE_COVERAGE_RULES
])


================================================
FILE: m4/ax_cxx_compile_stdcxx.m4
================================================
# ===========================================================================
#  https://www.gnu.org/software/autoconf-archive/ax_cxx_compile_stdcxx.html
# ===========================================================================
#
# SYNOPSIS
#
#   AX_CXX_COMPILE_STDCXX(VERSION, [ext|noext], [mandatory|optional])
#
# DESCRIPTION
#
#   Check for baseline language coverage in the compiler for the specified
#   version of the C++ standard.  If necessary, add switches to CXX and
#   CXXCPP to enable support.  VERSION may be '11' (for the C++11 standard)
#   or '14' (for the C++14 standard).
#
#   The second argument, if specified, indicates whether you insist on an
#   extended mode (e.g. -std=gnu++11) or a strict conformance mode (e.g.
#   -std=c++11).  If neither is specified, you get whatever works, with
#   preference for an extended mode.
#
#   The third argument, if specified 'mandatory' or if left unspecified,
#   indicates that baseline support for the specified C++ standard is
#   required and that the macro should error out if no mode with that
#   support is found.  If specified 'optional', then configuration proceeds
#   regardless, after defining HAVE_CXX${VERSION} if and only if a
#   supporting mode is found.
#
# LICENSE
#
#   Copyright (c) 2008 Benjamin Kosnik <bkoz@redhat.com>
#   Copyright (c) 2012 Zack Weinberg <zackw@panix.com>
#   Copyright (c) 2013 Roy Stogner <roystgnr@ices.utexas.edu>
#   Copyright (c) 2014, 2015 Google Inc.; contributed by Alexey Sokolov <sokolov@google.com>
#   Copyright (c) 2015 Paul Norman <penorman@mac.com>
#   Copyright (c) 2015 Moritz Klammler <moritz@klammler.eu>
#   Copyright (c) 2016, 2018 Krzesimir Nowak <qdlacz@gmail.com>
#
#   Copying and distribution of this file, with or without modification, are
#   permitted in any medium without royalty provided the copyright notice
#   and this notice are preserved.  This file is offered as-is, without any
#   warranty.

#serial 10

dnl  This macro is based on the code from the AX_CXX_COMPILE_STDCXX_11 macro
dnl  (serial version number 13).

AC_DEFUN([AX_CXX_COMPILE_STDCXX], [dnl
  m4_if([$1], [11], [ax_cxx_compile_alternatives="11 0x"],
        [$1], [14], [ax_cxx_compile_alternatives="14 1y"],
        [$1], [17], [ax_cxx_compile_alternatives="17 1z"],
        [m4_fatal([invalid first argument `$1' to AX_CXX_COMPILE_STDCXX])])dnl
  m4_if([$2], [], [],
        [$2], [ext], [],
        [$2], [noext], [],
        [m4_fatal([invalid second argument `$2' to AX_CXX_COMPILE_STDCXX])])dnl
  m4_if([$3], [], [ax_cxx_compile_cxx$1_required=true],
        [$3], [mandatory], [ax_cxx_compile_cxx$1_required=true],
        [$3], [optional], [ax_cxx_compile_cxx$1_required=false],
        [m4_fatal([invalid third argument `$3' to AX_CXX_COMPILE_STDCXX])])
  AC_LANG_PUSH([C++])dnl
  ac_success=no

  m4_if([$2], [noext], [], [dnl
  if test x$ac_success = xno; then
    for alternative in ${ax_cxx_compile_alternatives}; do
      switch="-std=gnu++${alternative}"
      cachevar=AS_TR_SH([ax_cv_cxx_compile_cxx$1_$switch])
      AC_CACHE_CHECK(whether $CXX supports C++$1 features with $switch,
                     $cachevar,
        [ac_save_CXX="$CXX"
         CXX="$CXX $switch"
         AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_testbody_$1])],
          [eval $cachevar=yes],
          [eval $cachevar=no])
         CXX="$ac_save_CXX"])
      if eval test x\$$cachevar = xyes; then
        CXX="$CXX $switch"
        if test -n "$CXXCPP" ; then
          CXXCPP="$CXXCPP $switch"
        fi
        ac_success=yes
        break
      fi
    done
  fi])

  m4_if([$2], [ext], [], [dnl
  if test x$ac_success = xno; then
    dnl HP's aCC needs +std=c++11 according to:
    dnl http://h21007.www2.hp.com/portal/download/files/unprot/aCxx/PDF_Release_Notes/769149-001.pdf
    dnl Cray's crayCC needs "-h std=c++11"
    for alternative in ${ax_cxx_compile_alternatives}; do
      for switch in -std=c++${alternative} +std=c++${alternative} "-h std=c++${alternative}"; do
        cachevar=AS_TR_SH([ax_cv_cxx_compile_cxx$1_$switch])
        AC_CACHE_CHECK(whether $CXX supports C++$1 features with $switch,
                       $cachevar,
          [ac_save_CXX="$CXX"
           CXX="$CXX $switch"
           AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_testbody_$1])],
            [eval $cachevar=yes],
            [eval $cachevar=no])
           CXX="$ac_save_CXX"])
        if eval test x\$$cachevar = xyes; then
          CXX="$CXX $switch"
          if test -n "$CXXCPP" ; then
            CXXCPP="$CXXCPP $switch"
          fi
          ac_success=yes
          break
        fi
      done
      if test x$ac_success = xyes; then
        break
      fi
    done
  fi])
  AC_LANG_POP([C++])
  if test x$ax_cxx_compile_cxx$1_required = xtrue; then
    if test x$ac_success = xno; then
      AC_MSG_ERROR([*** A compiler with support for C++$1 language features is required.])
    fi
  fi
  if test x$ac_success = xno; then
    HAVE_CXX$1=0
    AC_MSG_NOTICE([No compiler with C++$1 support was found])
  else
    HAVE_CXX$1=1
    AC_DEFINE(HAVE_CXX$1,1,
              [define if the compiler supports basic C++$1 syntax])
  fi
  AC_SUBST(HAVE_CXX$1)
])


dnl  Test body for checking C++11 support

m4_define([_AX_CXX_COMPILE_STDCXX_testbody_11],
  _AX_CXX_COMPILE_STDCXX_testbody_new_in_11
)


dnl  Test body for checking C++14 support

m4_define([_AX_CXX_COMPILE_STDCXX_testbody_14],
  _AX_CXX_COMPILE_STDCXX_testbody_new_in_11
  _AX_CXX_COMPILE_STDCXX_testbody_new_in_14
)

m4_define([_AX_CXX_COMPILE_STDCXX_testbody_17],
  _AX_CXX_COMPILE_STDCXX_testbody_new_in_11
  _AX_CXX_COMPILE_STDCXX_testbody_new_in_14
  _AX_CXX_COMPILE_STDCXX_testbody_new_in_17
)

dnl  Tests for new features in C++11

m4_define([_AX_CXX_COMPILE_STDCXX_testbody_new_in_11], [[

// If the compiler admits that it is not ready for C++11, why torture it?
// Hopefully, this will speed up the test.

#ifndef __cplusplus

#error "This is not a C++ compiler"

#elif __cplusplus < 201103L

#error "This is not a C++11 compiler"

#else

namespace cxx11
{

  namespace test_static_assert
  {

    template <typename T>
    struct check
    {
      static_assert(sizeof(int) <= sizeof(T), "not big enough");
    };

  }

  namespace test_final_override
  {

    struct Base
    {
      virtual void f() {}
    };

    struct Derived : public Base
    {
      virtual void f() override {}
    };

  }

  namespace test_double_right_angle_brackets
  {

    template < typename T >
    struct check {};

    typedef check<void> single_type;
    typedef check<check<void>> double_type;
    typedef check<check<check<void>>> triple_type;
    typedef check<check<check<check<void>>>> quadruple_type;

  }

  namespace test_decltype
  {

    int
    f()
    {
      int a = 1;
      decltype(a) b = 2;
      return a + b;
    }

  }

  namespace test_type_deduction
  {

    template < typename T1, typename T2 >
    struct is_same
    {
      static const bool value = false;
    };

    template < typename T >
    struct is_same<T, T>
    {
      static const bool value = true;
    };

    template < typename T1, typename T2 >
    auto
    add(T1 a1, T2 a2) -> decltype(a1 + a2)
    {
      return a1 + a2;
    }

    int
    test(const int c, volatile int v)
    {
      static_assert(is_same<int, decltype(0)>::value == true, "");
      static_assert(is_same<int, decltype(c)>::value == false, "");
      static_assert(is_same<int, decltype(v)>::value == false, "");
      auto ac = c;
      auto av = v;
      auto sumi = ac + av + 'x';
      auto sumf = ac + av + 1.0;
      static_assert(is_same<int, decltype(ac)>::value == true, "");
      static_assert(is_same<int, decltype(av)>::value == true, "");
      static_assert(is_same<int, decltype(sumi)>::value == true, "");
      static_assert(is_same<int, decltype(sumf)>::value == false, "");
      static_assert(is_same<int, decltype(add(c, v))>::value == true, "");
      return (sumf > 0.0) ? sumi : add(c, v);
    }

  }

  namespace test_noexcept
  {

    int f() { return 0; }
    int g() noexcept { return 0; }

    static_assert(noexcept(f()) == false, "");
    static_assert(noexcept(g()) == true, "");

  }

  namespace test_constexpr
  {

    template < typename CharT >
    unsigned long constexpr
    strlen_c_r(const CharT *const s, const unsigned long acc) noexcept
    {
      return *s ? strlen_c_r(s + 1, acc + 1) : acc;
    }

    template < typename CharT >
    unsigned long constexpr
    strlen_c(const CharT *const s) noexcept
    {
      return strlen_c_r(s, 0UL);
    }

    static_assert(strlen_c("") == 0UL, "");
    static_assert(strlen_c("1") == 1UL, "");
    static_assert(strlen_c("example") == 7UL, "");
    static_assert(strlen_c("another\0example") == 7UL, "");

  }

  namespace test_rvalue_references
  {

    template < int N >
    struct answer
    {
      static constexpr int value = N;
    };

    answer<1> f(int&)       { return answer<1>(); }
    answer<2> f(const int&) { return answer<2>(); }
    answer<3> f(int&&)      { return answer<3>(); }

    void
    test()
    {
      int i = 0;
      const int c = 0;
      static_assert(decltype(f(i))::value == 1, "");
      static_assert(decltype(f(c))::value == 2, "");
      static_assert(decltype(f(0))::value == 3, "");
    }

  }

  namespace test_uniform_initialization
  {

    struct test
    {
      static const int zero {};
      static const int one {1};
    };

    static_assert(test::zero == 0, "");
    static_assert(test::one == 1, "");

  }

  namespace test_lambdas
  {

    void
    test1()
    {
      auto lambda1 = [](){};
      auto lambda2 = lambda1;
      lambda1();
      lambda2();
    }

    int
    test2()
    {
      auto a = [](int i, int j){ return i + j; }(1, 2);
      auto b = []() -> int { return '0'; }();
      auto c = [=](){ return a + b; }();
      auto d = [&](){ return c; }();
      auto e = [a, &b](int x) mutable {
        const auto identity = [](int y){ return y; };
        for (auto i = 0; i < a; ++i)
          a += b--;
        return x + identity(a + b);
      }(0);
      return a + b + c + d + e;
    }

    int
    test3()
    {
      const auto nullary = [](){ return 0; };
      const auto unary = [](int x){ return x; };
      using nullary_t = decltype(nullary);
      using unary_t = decltype(unary);
      const auto higher1st = [](nullary_t f){ return f(); };
      const auto higher2nd = [unary](nullary_t f1){
        return [unary, f1](unary_t f2){ return f2(unary(f1())); };
      };
      return higher1st(nullary) + higher2nd(nullary)(unary);
    }

  }

  namespace test_variadic_templates
  {

    template <int...>
    struct sum;

    template <int N0, int... N1toN>
    struct sum<N0, N1toN...>
    {
      static constexpr auto value = N0 + sum<N1toN...>::value;
    };

    template <>
    struct sum<>
    {
      static constexpr auto value = 0;
    };

    static_assert(sum<>::value == 0, "");
    static_assert(sum<1>::value == 1, "");
    static_assert(sum<23>::value == 23, "");
    static_assert(sum<1, 2>::value == 3, "");
    static_assert(sum<5, 5, 11>::value == 21, "");
    static_assert(sum<2, 3, 5, 7, 11, 13>::value == 41, "");

  }

  // http://stackoverflow.com/questions/13728184/template-aliases-and-sfinae
  // Clang 3.1 fails with headers of libstd++ 4.8.3 when using std::function
  // because of this.
  namespace test_template_alias_sfinae
  {

    struct foo {};

    template<typename T>
    using member = typename T::member_type;

    template<typename T>
    void func(...) {}

    template<typename T>
    void func(member<T>*) {}

    void test();

    void test() { func<foo>(0); }

  }

}  // namespace cxx11

#endif  // __cplusplus >= 201103L

]])


dnl  Tests for new features in C++14

m4_define([_AX_CXX_COMPILE_STDCXX_testbody_new_in_14], [[

// If the compiler admits that it is not ready for C++14, why torture it?
// Hopefully, this will speed up the test.

#ifndef __cplusplus

#error "This is not a C++ compiler"

#elif __cplusplus < 201402L

#error "This is not a C++14 compiler"

#else

namespace cxx14
{

  namespace test_polymorphic_lambdas
  {

    int
    test()
    {
      const auto lambda = [](auto&&... args){
        const auto istiny = [](auto x){
          return (sizeof(x) == 1UL) ? 1 : 0;
        };
        const int aretiny[] = { istiny(args)... };
        return aretiny[0];
      };
      return lambda(1, 1L, 1.0f, '1');
    }

  }

  namespace test_binary_literals
  {

    constexpr auto ivii = 0b0000000000101010;
    static_assert(ivii == 42, "wrong value");

  }

  namespace test_generalized_constexpr
  {

    template < typename CharT >
    constexpr unsigned long
    strlen_c(const CharT *const s) noexcept
    {
      auto length = 0UL;
      for (auto p = s; *p; ++p)
        ++length;
      return length;
    }

    static_assert(strlen_c("") == 0UL, "");
    static_assert(strlen_c("x") == 1UL, "");
    static_assert(strlen_c("test") == 4UL, "");
    static_assert(strlen_c("another\0test") == 7UL, "");

  }

  namespace test_lambda_init_capture
  {

    int
    test()
    {
      auto x = 0;
      const auto lambda1 = [a = x](int b){ return a + b; };
      const auto lambda2 = [a = lambda1(x)](){ return a; };
      return lambda2();
    }

  }

  namespace test_digit_separators
  {

    constexpr auto ten_million = 100'000'000;
    static_assert(ten_million == 100000000, "");

  }

  namespace test_return_type_deduction
  {

    auto f(int& x) { return x; }
    decltype(auto) g(int& x) { return x; }

    template < typename T1, typename T2 >
    struct is_same
    {
      static constexpr auto value = false;
    };

    template < typename T >
    struct is_same<T, T>
    {
      static constexpr auto value = true;
    };

    int
    test()
    {
      auto x = 0;
      static_assert(is_same<int, decltype(f(x))>::value, "");
      static_assert(is_same<int&, decltype(g(x))>::value, "");
      return x;
    }

  }

}  // namespace cxx14

#endif  // __cplusplus >= 201402L

]])


dnl  Tests for new features in C++17

m4_define([_AX_CXX_COMPILE_STDCXX_testbody_new_in_17], [[

// If the compiler admits that it is not ready for C++17, why torture it?
// Hopefully, this will speed up the test.

#ifndef __cplusplus

#error "This is not a C++ compiler"

#elif __cplusplus < 201703L

#error "This is not a C++17 compiler"

#else

#include <initializer_list>
#include <utility>
#include <type_traits>

namespace cxx17
{

  namespace test_constexpr_lambdas
  {

    constexpr int foo = [](){return 42;}();

  }

  namespace test::nested_namespace::definitions
  {

  }

  namespace test_fold_expression
  {

    template<typename... Args>
    int multiply(Args... args)
    {
      return (args * ... * 1);
    }

    template<typename... Args>
    bool all(Args... args)
    {
      return (args && ...);
    }

  }

  namespace test_extended_static_assert
  {

    static_assert (true);

  }

  namespace test_auto_brace_init_list
  {

    auto foo = {5};
    auto bar {5};

    static_assert(std::is_same<std::initializer_list<int>, decltype(foo)>::value);
    static_assert(std::is_same<int, decltype(bar)>::value);
  }

  namespace test_typename_in_template_template_parameter
  {

    template<template<typename> typename X> struct D;

  }

  namespace test_fallthrough_nodiscard_maybe_unused_attributes
  {

    int f1()
    {
      return 42;
    }

    [[nodiscard]] int f2()
    {
      [[maybe_unused]] auto unused = f1();

      switch (f1())
      {
      case 17:
        f1();
        [[fallthrough]];
      case 42:
        f1();
      }
      return f1();
    }

  }

  namespace test_extended_aggregate_initialization
  {

    struct base1
    {
      int b1, b2 = 42;
    };

    struct base2
    {
      base2() {
        b3 = 42;
      }
      int b3;
    };

    struct derived : base1, base2
    {
        int d;
    };

    derived d1 {{1, 2}, {}, 4};  // full initialization
    derived d2 {{}, {}, 4};      // value-initialized bases

  }

  namespace test_general_range_based_for_loop
  {

    struct iter
    {
      int i;

      int& operator* ()
      {
        return i;
      }

      const int& operator* () const
      {
        return i;
      }

      iter& operator++()
      {
        ++i;
        return *this;
      }
    };

    struct sentinel
    {
      int i;
    };

    bool operator== (const iter& i, const sentinel& s)
    {
      return i.i == s.i;
    }

    bool operator!= (const iter& i, const sentinel& s)
    {
      return !(i == s);
    }

    struct range
    {
      iter begin() const
      {
        return {0};
      }

      sentinel end() const
      {
        return {5};
      }
    };

    void f()
    {
      range r {};

      for (auto i : r)
      {
        [[maybe_unused]] auto v = i;
      }
    }

  }

  namespace test_lambda_capture_asterisk_this_by_value
  {

    struct t
    {
      int i;
      int foo()
      {
        return [*this]()
        {
          return i;
        }();
      }
    };

  }

  namespace test_enum_class_construction
  {

    enum class byte : unsigned char
    {};

    byte foo {42};

  }

  namespace test_constexpr_if
  {

    template <bool cond>
    int f ()
    {
      if constexpr(cond)
      {
        return 13;
      }
      else
      {
        return 42;
      }
    }

  }

  namespace test_selection_statement_with_initializer
  {

    int f()
    {
      return 13;
    }

    int f2()
    {
      if (auto i = f(); i > 0)
      {
        return 3;
      }

      switch (auto i = f(); i + 4)
      {
      case 17:
        return 2;

      default:
        return 1;
      }
    }

  }

  namespace test_template_argument_deduction_for_class_templates
  {

    template <typename T1, typename T2>
    struct pair
    {
      pair (T1 p1, T2 p2)
        : m1 {p1},
          m2 {p2}
      {}

      T1 m1;
      T2 m2;
    };

    void f()
    {
      [[maybe_unused]] auto p = pair{13, 42u};
    }

  }

  namespace test_non_type_auto_template_parameters
  {

    template <auto n>
    struct B
    {};

    B<5> b1;
    B<'a'> b2;

  }

  namespace test_structured_bindings
  {

    int arr[2] = { 1, 2 };
    std::pair<int, int> pr = { 1, 2 };

    auto f1() -> int(&)[2]
    {
      return arr;
    }

    auto f2() -> std::pair<int, int>&
    {
      return pr;
    }

    struct S
    {
      int x1 : 2;
      volatile double y1;
    };

    S f3()
    {
      return {};
    }

    auto [ x1, y1 ] = f1();
    auto& [ xr1, yr1 ] = f1();
    auto [ x2, y2 ] = f2();
    auto& [ xr2, yr2 ] = f2();
    const auto [ x3, y3 ] = f3();

  }

  namespace test_exception_spec_type_system
  {

    struct Good {};
    struct Bad {};

    void g1() noexcept;
    void g2();

    template<typename T>
    Bad
    f(T*, T*);

    template<typename T1, typename T2>
    Good
    f(T1*, T2*);

    static_assert (std::is_same_v<Good, decltype(f(g1, g2))>);

  }

  namespace test_inline_variables
  {

    template<class T> void f(T)
    {}

    template<class T> inline T g(T)
    {
      return T{};
    }

    template<> inline void f<>(int)
    {}

    template<> int g<>(int)
    {
      return 5;
    }

  }

}  // namespace cxx17

#endif  // __cplusplus < 201703L

]])


================================================
FILE: m4/ax_file_escapes.m4
================================================
# ===========================================================================
#     https://www.gnu.org/software/autoconf-archive/ax_file_escapes.html
# ===========================================================================
#
# SYNOPSIS
#
#   AX_FILE_ESCAPES
#
# DESCRIPTION
#
#   Writes the specified data to the specified file.
#
# LICENSE
#
#   Copyright (c) 2008 Tom Howard <tomhoward@users.sf.net>
#
#   Copying and distribution of this file, with or without modification, are
#   permitted in any medium without royalty provided the copyright notice
#   and this notice are preserved. This file is offered as-is, without any
#   warranty.

#serial 8

AC_DEFUN([AX_FILE_ESCAPES],[
AX_DOLLAR="\$"
AX_SRB="\\135"
AX_SLB="\\133"
AX_BS="\\\\"
AX_DQ="\""
])


================================================
FILE: m4/ax_require_defined.m4
================================================
# ===========================================================================
#    https://www.gnu.org/software/autoconf-archive/ax_require_defined.html
# ===========================================================================
#
# SYNOPSIS
#
#   AX_REQUIRE_DEFINED(MACRO)
#
# DESCRIPTION
#
#   AX_REQUIRE_DEFINED is a simple helper for making sure other macros have
#   been defined and thus are available for use.  This avoids random issues
#   where a macro isn't expanded.  Instead the configure script emits a
#   non-fatal:
#
#     ./configure: line 1673: AX_CFLAGS_WARN_ALL: command not found
#
#   It's like AC_REQUIRE except it doesn't expand the required macro.
#
#   Here's an example:
#
#     AX_REQUIRE_DEFINED([AX_CHECK_LINK_FLAG])
#
# LICENSE
#
#   Copyright (c) 2014 Mike Frysinger <vapier@gentoo.org>
#
#   Copying and distribution of this file, with or without modification, are
#   permitted in any medium without royalty provided the copyright notice
#   and this notice are preserved. This file is offered as-is, without any
#   warranty.

#serial 2

AC_DEFUN([AX_REQUIRE_DEFINED], [dnl
  m4_ifndef([$1], [m4_fatal([macro ]$1[ is not defined; is a m4 file missing?])])
])dnl AX_REQUIRE_DEFINED


================================================
FILE: m4/ax_with_curses.m4
================================================
# ===========================================================================
#      http://www.gnu.org/software/autoconf-archive/ax_with_curses.html
# ===========================================================================
#
# SYNOPSIS
#
#   AX_WITH_CURSES
#
# DESCRIPTION
#
#   This macro checks whether a SysV or X/Open-compatible Curses library is
#   present, along with the associated header file.  The NcursesW
#   (wide-character) library is searched for first, followed by Ncurses,
#   then the system-default plain Curses.  The first library found is the
#   one returned.
#
#   The following options are understood: --with-ncursesw, --with-ncurses,
#   --without-ncursesw, --without-ncurses.  The "--with" options force the
#   macro to use that particular library, terminating with an error if not
#   found.  The "--without" options simply skip the check for that library.
#   The effect on the search pattern is:
#
#     (no options)                           - NcursesW, Ncurses, Curses
#     --with-ncurses     --with-ncursesw     - NcursesW only [*]
#     --without-ncurses  --with-ncursesw     - NcursesW only [*]
#                        --with-ncursesw     - NcursesW only [*]
#     --with-ncurses     --without-ncursesw  - Ncurses only [*]
#     --with-ncurses                         - NcursesW, Ncurses [**]
#     --without-ncurses  --without-ncursesw  - Curses only
#                        --without-ncursesw  - Ncurses, Curses
#     --without-ncurses                      - NcursesW, Curses
#
#   [*]  If the library is not found, abort the configure script.
#
#   [**] If the second library (Ncurses) is not found, abort configure.
#
#   The following preprocessor symbols may be defined by this macro if the
#   appropriate conditions are met:
#
#     HAVE_CURSES             - if any SysV or X/Open Curses library found
#     HAVE_CURSES_ENHANCED    - if library supports X/Open Enhanced functions
#     HAVE_CURSES_COLOR       - if library supports color (enhanced functions)
#     HAVE_CURSES_OBSOLETE    - if library supports certain obsolete features
#     HAVE_NCURSESW           - if NcursesW (wide char) library is to be used
#     HAVE_NCURSES            - if the Ncurses library is to be used
#
#     HAVE_CURSES_H           - if <curses.h> is present and should be used
#     HAVE_NCURSESW_H         - if <ncursesw.h> should be used
#     HAVE_NCURSES_H          - if <ncurses.h> should be used
#     HAVE_NCURSESW_CURSES_H  - if <ncursesw/curses.h> should be used
#     HAVE_NCURSES_CURSES_H   - if <ncurses/curses.h> should be used
#
#   (These preprocessor symbols are discussed later in this document.)
#
#   The following output variable is defined by this macro; it is precious
#   and may be overridden on the ./configure command line:
#
#     CURSES_LIB  - library to add to xxx_LDADD
#
#   The library listed in CURSES_LIB is NOT added to LIBS by default. You
#   need to add CURSES_LIB to the appropriate xxx_LDADD line in your
#   Makefile.am.  For example:
#
#     prog_LDADD = @CURSES_LIB@
#
#   If CURSES_LIB is set on the configure command line (such as by running
#   "./configure CURSES_LIB=-lmycurses"), then the only header searched for
#   is <curses.h>.  The user may use the CPPFLAGS precious variable to
#   override the standard #include search path.  If the user needs to
#   specify an alternative path for a library (such as for a non-standard
#   NcurseW), the user should use the LDFLAGS variable.
#
#   The following shell variables may be defined by this macro:
#
#     ax_cv_curses           - set to "yes" if any Curses library found
#     ax_cv_curses_enhanced  - set to "yes" if Enhanced functions present
#     ax_cv_curses_color     - set to "yes" if color functions present
#     ax_cv_curses_obsolete  - set to "yes" if obsolete features present
#
#     ax_cv_ncursesw      - set to "yes" if NcursesW library found
#     ax_cv_ncurses       - set to "yes" if Ncurses library found
#     ax_cv_plaincurses   - set to "yes" if plain Curses library found
#     ax_cv_curses_which  - set to "ncursesw", "ncurses", "plaincurses" or "no"
#
#   These variables can be used in your configure.ac to determine the level
#   of support you need from the Curses library.  For example, if you must
#   have either Ncurses or NcursesW, you could include:
#
#     AX_WITH_CURSES
#     if test "x$ax_cv_ncursesw" != xyes && test "x$ax_cv_ncurses" != xyes; then
#         AX_MSG_ERROR([requires either NcursesW or Ncurses library])
#     fi
#
#   If any Curses library will do (but one must be present and must support
#   color), you could use:
#
#     AX_WITH_CURSES
#     if test "x$ax_cv_curses" != xyes || test "x$ax_cv_curses_color" != xyes; then
#         AC_MSG_ERROR([requires an X/Open-compatible Curses library with color])
#     fi
#
#   Certain preprocessor symbols and shell variables defined by this macro
#   can be used to determine various features of the Curses library.  In
#   particular, HAVE_CURSES and ax_cv_curses are defined if the Curses
#   library found conforms to the traditional SysV and/or X/Open Base Curses
#   definition.  Any working Curses library conforms to this level.
#
#   HAVE_CURSES_ENHANCED and ax_cv_curses_enhanced are defined if the
#   library supports the X/Open Enhanced Curses definition.  In particular,
#   the wide-character types attr_t, cchar_t and wint_t, the functions
#   wattr_set() and wget_wch() and the macros WA_NORMAL and _XOPEN_CURSES
#   are checked.  The Ncurses library does NOT conform to this definition,
#   although NcursesW does.
#
#   HAVE_CURSES_COLOR and ax_cv_curses_color are defined if the library
#   supports color functions and macros such as COLOR_PAIR, A_COLOR,
#   COLOR_WHITE, COLOR_RED and init_pair().  These are NOT part of the
#   X/Open Base Curses definition, but are part of the Enhanced set of
#   functions.  The Ncurses library DOES support these functions, as does
#   NcursesW.
#
#   HAVE_CURSES_OBSOLETE and ax_cv_curses_obsolete are defined if the
#   library supports certain features present in SysV and BSD Curses but not
#   defined in the X/Open definition.  In particular, the functions
#   getattrs(), getcurx() and getmaxx() are checked.
#
#   To use the HAVE_xxx_H preprocessor symbols, insert the following into
#   your system.h (or equivalent) header file:
#
#     #if defined HAVE_NCURSESW_CURSES_H
#     #  include <ncursesw/curses.h>
#     #elif defined HAVE_NCURSESW_H
#     #  include <ncursesw.h>
#     #elif defined HAVE_NCURSES_CURSES_H
#     #  include <ncurses/curses.h>
#     #elif defined HAVE_NCURSES_H
#     #  include <ncurses.h>
#     #elif defined HAVE_CURSES_H
#     #  include <curses.h>
#     #else
#     #  error "SysV or X/Open-compatible Curses header file required"
#     #endif
#
#   For previous users of this macro: you should not need to change anything
#   in your configure.ac or Makefile.am, as the previous (serial 10)
#   semantics are still valid.  However, you should update your system.h (or
#   equivalent) header file to the fragment shown above. You are encouraged
#   also to make use of the extended functionality provided by this version
#   of AX_WITH_CURSES, as well as in the additional macros
#   AX_WITH_CURSES_PANEL, AX_WITH_CURSES_MENU and AX_WITH_CURSES_FORM.
#
# LICENSE
#
#   Copyright (c) 2009 Mark Pulford <mark@kyne.com.au>
#   Copyright (c) 2009 Damian Pietras <daper@daper.net>
#   Copyright (c) 2012 Reuben Thomas <rrt@sc3d.org>
#   Copyright (c) 2011 John Zaitseff <J.Zaitseff@zap.org.au>
#
#   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/>.
#
#   As a special exception, the respective Autoconf Macro's copyright owner
#   gives unlimited permission to copy, distribute and modify the configure
#   scripts that are the output of Autoconf when processing the Macro. You
#   need not follow the terms of the GNU General Public License when usi
Download .txt
gitextract_40azl391/

├── .clang-format
├── .gitattributes
├── .github/
│   └── workflows/
│       ├── ci.yml
│       ├── cifuzz.yml
│       ├── clang-format.yml
│       └── release.yml
├── .gitignore
├── AUTHORS
├── COPYING
├── COPYING.iOS
├── ChangeLog
├── Makefile.am
├── NEWS
├── README.md
├── THANKS
├── autogen.sh
├── build-package.sh
├── build-source-package.sh
├── conf/
│   ├── Makefile.am
│   ├── bash-completion/
│   │   └── completions/
│   │       └── mosh
│   └── ufw/
│       └── applications.d/
│           └── mosh
├── configure.ac
├── debian/
│   ├── changelog
│   ├── control
│   ├── copyright
│   ├── docs
│   ├── mosh.maintscript
│   ├── rules
│   ├── source/
│   │   └── format
│   └── watch
├── fedora/
│   └── mosh.spec
├── m4/
│   ├── ax_ac_append_to_file.m4
│   ├── ax_ac_print_to_file.m4
│   ├── ax_add_am_macro_static.m4
│   ├── ax_am_macros_static.m4
│   ├── ax_check_compile_flag.m4
│   ├── ax_check_gnu_make.m4
│   ├── ax_check_library.m4
│   ├── ax_check_link_flag.m4
│   ├── ax_code_coverage.m4
│   ├── ax_cxx_compile_stdcxx.m4
│   ├── ax_file_escapes.m4
│   ├── ax_require_defined.m4
│   ├── ax_with_curses.m4
│   └── pkg.m4
├── macosx/
│   ├── .gitignore
│   ├── Distribution.in
│   ├── brew-deps.sh
│   ├── build.sh
│   ├── copying.rtf
│   ├── gtar
│   ├── mosh-package.pmdoc.in/
│   │   ├── 01prefix-contents.xml
│   │   ├── 01prefix.xml
│   │   └── index.xml
│   ├── osx-xcode.sh
│   ├── port-deps.sh
│   └── readme.rtf
├── man/
│   ├── Makefile.am
│   ├── mosh-client.1
│   ├── mosh-server.1
│   └── mosh.1
├── ocb-license.html
├── scripts/
│   ├── Makefile.am
│   ├── mosh.pl
│   └── wrap-compiler-for-flag-check
└── src/
    ├── Makefile.am
    ├── crypto/
    │   ├── Makefile.am
    │   ├── ae.h
    │   ├── base64.cc
    │   ├── base64.h
    │   ├── byteorder.h
    │   ├── crypto.cc
    │   ├── crypto.h
    │   ├── ocb_internal.cc
    │   ├── ocb_openssl.cc
    │   └── prng.h
    ├── examples/
    │   ├── .gitignore
    │   ├── Makefile.am
    │   ├── benchmark.cc
    │   ├── decrypt.cc
    │   ├── encrypt.cc
    │   ├── ntester.cc
    │   ├── parse.cc
    │   └── termemu.cc
    ├── frontend/
    │   ├── .gitignore
    │   ├── Makefile.am
    │   ├── mosh-client.cc
    │   ├── mosh-server.cc
    │   ├── stmclient.cc
    │   ├── stmclient.h
    │   ├── terminaloverlay.cc
    │   └── terminaloverlay.h
    ├── fuzz/
    │   ├── Makefile.am
    │   ├── terminal_corpus/
    │   │   ├── 3769c52698d426976ee402b9dbc3c2a7bd5e5485
    │   │   ├── 3a52ce780950d4d969792a2559cd519d7ee8c727
    │   │   ├── 3facad9d449f8b10a2d18ef821325639214afc3c
    │   │   ├── 433f367f36f48f78570c2013fef7a4f4b52b7c0c
    │   │   ├── 5ba93c9db0cff93f52b521d7420e43f6eda2784f
    │   │   ├── 64b6cc492319c39d017963ee8f5863520eb7b6b9
    │   │   ├── 7c4d33785daa5c2370201ffa236b427aa37c9996
    │   │   ├── 7fff5c5bdfcaecbe749a7eda1f831a4b0ac6c285
    │   │   ├── 94fc46a4dd7043c8a22bc85f24aafdf0bc963125
    │   │   ├── 9a78211436f6d425ec38f5c4e02270801f3524f8
    │   │   ├── a70a7fcfa8e88039504b6a798314285419f51e16
    │   │   ├── adc83b19e793491b1c6ea0fd8b46cd9f32e592fc
    │   │   ├── bf72240ede73688a77e62c38b4a112f15cb61802
    │   │   ├── c822a8bc8c7d9f938990c2bfd0b24fd9d48af917
    │   │   ├── e0d3c08cb28736844512c52dc05fa4e4efd91490
    │   │   └── f195c020a28dfc5f2fb6af256b524ddcd93756ed
    │   ├── terminal_fuzzer.cc
    │   ├── terminal_parser_corpus/
    │   │   ├── 7164cb6ab7e834fa6145bcf283e94b981313980d
    │   │   ├── 71853c6197a6a7f222db0f1978c7cb232b87c5ee
    │   │   ├── 7b98b1bb85d1afb4f154cfbe9c3d4791024a86b7
    │   │   ├── 8a92b4d6e188b3e2fa7add9e123b702ed11f3695
    │   │   ├── 99feeb7f36e52ff59d86c975a8e5ad1a2ab4629e
    │   │   ├── 9d5e4e241c99c93786eeddcd93c5ec23dd563881
    │   │   ├── 9e016e2a52e879c9c6482303eea8eb7d92b4dd38
    │   │   ├── a09fd95888cb80e1dcea4cc9dbd7d76928909927
    │   │   ├── abb6d63b8f739c45c3c44f1772b88338e9b5e7a3
    │   │   ├── adc83b19e793491b1c6ea0fd8b46cd9f32e592fc
    │   │   └── b67f23988e8274fcf6150a18dacb5ab3db49520d
    │   └── terminal_parser_fuzzer.cc
    ├── include/
    │   └── Makefile.am
    ├── network/
    │   ├── Makefile.am
    │   ├── compressor.cc
    │   ├── compressor.h
    │   ├── network.cc
    │   ├── network.h
    │   ├── networktransport-impl.h
    │   ├── networktransport.h
    │   ├── transportfragment.cc
    │   ├── transportfragment.h
    │   ├── transportsender-impl.h
    │   ├── transportsender.h
    │   └── transportstate.h
    ├── protobufs/
    │   ├── Makefile.am
    │   ├── hostinput.proto
    │   ├── transportinstruction.proto
    │   └── userinput.proto
    ├── statesync/
    │   ├── Makefile.am
    │   ├── completeterminal.cc
    │   ├── completeterminal.h
    │   ├── user.cc
    │   └── user.h
    ├── terminal/
    │   ├── Makefile.am
    │   ├── parser.cc
    │   ├── parser.h
    │   ├── parseraction.cc
    │   ├── parseraction.h
    │   ├── parserstate.cc
    │   ├── parserstate.h
    │   ├── parserstatefamily.h
    │   ├── parsertransition.h
    │   ├── terminal.cc
    │   ├── terminal.h
    │   ├── terminaldispatcher.cc
    │   ├── terminaldispatcher.h
    │   ├── terminaldisplay.cc
    │   ├── terminaldisplay.h
    │   ├── terminaldisplayinit.cc
    │   ├── terminalframebuffer.cc
    │   ├── terminalframebuffer.h
    │   ├── terminalfunctions.cc
    │   ├── terminaluserinput.cc
    │   └── terminaluserinput.h
    ├── tests/
    │   ├── .gitignore
    │   ├── Makefile.am
    │   ├── README.md
    │   ├── base64.cc
    │   ├── base64_vector.h
    │   ├── e2e-failure.test
    │   ├── e2e-success.test
    │   ├── e2e-test
    │   ├── e2e-test-server
    │   ├── e2e-test-subrs
    │   ├── emulation-80th-column.test
    │   ├── emulation-ascii-iso-8859.test
    │   ├── emulation-attributes.test
    │   ├── emulation-back-tab.test
    │   ├── emulation-cursor-motion.test
    │   ├── emulation-multiline-scroll.test
    │   ├── emulation-scroll.test
    │   ├── emulation-wrap-across-frames.test
    │   ├── encrypt-decrypt.cc
    │   ├── genbase64.pl
    │   ├── hold-stdin
    │   ├── inpty.cc
    │   ├── is-utf8-locale.cc
    │   ├── local.test
    │   ├── network-no-diff.test
    │   ├── nonce-incr.cc
    │   ├── ocb-aes.cc
    │   ├── prediction-unicode.test
    │   ├── print-exitstatus
    │   ├── pty-deadlock.test
    │   ├── repeat.test
    │   ├── server-network-timeout.test
    │   ├── test_utils.cc
    │   ├── test_utils.h
    │   ├── unicode-combine-fallback-assert.test
    │   ├── unicode-later-combining.test
    │   └── window-resize.test
    └── util/
        ├── Makefile.am
        ├── dos_assert.h
        ├── fatal_assert.h
        ├── locale_utils.cc
        ├── locale_utils.h
        ├── pty_compat.cc
        ├── pty_compat.h
        ├── select.cc
        ├── select.h
        ├── swrite.cc
        ├── swrite.h
        ├── timestamp.cc
        └── timestamp.h
Download .txt
SYMBOL INDEX (308 symbols across 67 files)

FILE: src/crypto/ae.h
  type ae_ctx (line 50) | typedef struct _ae_ctx ae_ctx;

FILE: src/crypto/base64.cc
  function base64_char_to_sixbit (line 63) | static unsigned char base64_char_to_sixbit( unsigned char c )
  function base64_decode (line 68) | bool base64_decode( const char* b64, const size_t b64_len, uint8_t* raw,...
  function base64_encode (line 98) | void base64_encode( const uint8_t* raw, const size_t raw_len, char* b64,...

FILE: src/crypto/byteorder.h
  function htobe64 (line 73) | inline uint64_t htobe64( uint64_t x )
  function be64toh (line 91) | inline uint64_t be64toh( uint64_t x )
  function htobe16 (line 103) | inline uint16_t htobe16( uint16_t x )
  function be16toh (line 114) | inline uint16_t be16toh( uint16_t x )

FILE: src/crypto/crypto.cc
  function myatoi (line 50) | long int myatoi( const char* str )
  function Message (line 245) | const Message Session::decrypt( const char* str, size_t len )
  type rlimit (line 290) | struct rlimit
  type rlimit (line 309) | struct rlimit

FILE: src/crypto/crypto.h
  function namespace (line 48) | namespace Crypto {

FILE: src/crypto/ocb_internal.cc
  function bswap64 (line 144) | static inline uint64_t bswap64(uint64_t x) {
  function ntz (line 154) | static inline unsigned ntz(unsigned x) {_BitScanForward(&x,x);return x;}
  function ntz (line 161) | static inline unsigned ntz(unsigned x) {
  function ntz (line 170) | static inline unsigned ntz(unsigned x) {
  function block (line 196) | static inline block swap_if_le(block b) {
  function block (line 203) | static inline block gen_offset(uint64_t KtopStr[3], unsigned bot) {
  function block (line 215) | static inline block double_block(block bl) {
  function block (line 231) | static block gen_offset(uint64_t KtopStr[3], unsigned bot) {
  function block (line 239) | static block gen_offset(uint64_t KtopStr[3], unsigned bot) {
  function block (line 261) | static inline block double_block(block b) {
  function unequal_blocks (line 278) | static inline int unequal_blocks(block a, block b) {
  function block (line 284) | static block gen_offset(uint64_t KtopStr[3], unsigned bot) {
  function block (line 297) | static inline block double_block(block b)
  function block (line 308) | static inline block xor_block(block x, block y) {
  function block (line 311) | static inline block zero_block(void) { const block t = {0,0}; return t; }
  function block (line 313) | static inline block swap_if_le(block b) {
  function block (line 325) | static block gen_offset(uint64_t KtopStr[3], unsigned bot) {
  function block (line 338) | static inline block double_block(block b) {
  function block (line 349) | static inline block double_block(block b) {
  type ocb_aes (line 369) | namespace ocb_aes {
    function KEY (line 375) | static KEY *KEY_new() {
    function KEY_delete (line 383) | static void KEY_delete(KEY *key) { EVP_CIPHER_CTX_free(key); }
    function set_encrypt_key (line 385) | static void set_encrypt_key(const unsigned char *user_key, int bits, K...
    function set_decrypt_key (line 405) | static void set_decrypt_key(const unsigned char *user_key, int bits, K...
    function encrypt (line 414) | static void encrypt(const unsigned char *in, unsigned char *out, KEY *...
    function decrypt (line 437) | static void decrypt(const unsigned char *in, unsigned char *out, KEY *...
    function ecb_encrypt_blks (line 458) | static void ecb_encrypt_blks(block *blks, unsigned nblks, KEY *key) {
    function ecb_decrypt_blks (line 465) | static void ecb_decrypt_blks(block *blks, unsigned nblks, KEY *key) {
    function KEY (line 489) | static KEY *KEY_new() { return new KEY; }
    function KEY_delete (line 491) | static void KEY_delete(KEY *key) { delete key; }
    function set_encrypt_key (line 493) | static void set_encrypt_key(const unsigned char *handle, const int bit...
    function set_decrypt_key (line 509) | static void set_decrypt_key(const unsigned char *handle, const int bit...
    function encrypt (line 525) | static void encrypt(unsigned char *src, unsigned char *dst, KEY *key) {
    function decrypt (line 539) | static void decrypt(unsigned char *src, unsigned char *dst, KEY *key) {
    function ecb_encrypt_blks (line 543) | static void ecb_encrypt_blks(block *blks, unsigned nblks, KEY *key) {
    function ecb_decrypt_blks (line 556) | static void ecb_decrypt_blks(block *blks, unsigned nblks, KEY *key) {
    type aes128_ctx (line 572) | struct aes128_ctx
    function KEY (line 574) | static KEY *KEY_new() { return new KEY; }
    function KEY_delete (line 576) | static void KEY_delete(KEY *key) { delete key; }
    function set_encrypt_key (line 578) | static void set_encrypt_key(const unsigned char *handle, const int bit...
    function set_decrypt_key (line 583) | static void set_decrypt_key(const unsigned char *handle, const int bit...
    function encrypt (line 588) | static void encrypt(unsigned char *src, unsigned char *dst, KEY *key) {
    function decrypt (line 593) | static void decrypt(unsigned char *src, unsigned char *dst, KEY *key) {
    function ecb_encrypt_blks (line 597) | static void ecb_encrypt_blks(block *blks, unsigned nblks, KEY *key) {
    function ecb_decrypt_blks (line 600) | static void ecb_decrypt_blks(block *blks, unsigned nblks, KEY *key) {
  type ocb_aes (line 482) | namespace ocb_aes {
    function KEY (line 375) | static KEY *KEY_new() {
    function KEY_delete (line 383) | static void KEY_delete(KEY *key) { EVP_CIPHER_CTX_free(key); }
    function set_encrypt_key (line 385) | static void set_encrypt_key(const unsigned char *user_key, int bits, K...
    function set_decrypt_key (line 405) | static void set_decrypt_key(const unsigned char *user_key, int bits, K...
    function encrypt (line 414) | static void encrypt(const unsigned char *in, unsigned char *out, KEY *...
    function decrypt (line 437) | static void decrypt(const unsigned char *in, unsigned char *out, KEY *...
    function ecb_encrypt_blks (line 458) | static void ecb_encrypt_blks(block *blks, unsigned nblks, KEY *key) {
    function ecb_decrypt_blks (line 465) | static void ecb_decrypt_blks(block *blks, unsigned nblks, KEY *key) {
    function KEY (line 489) | static KEY *KEY_new() { return new KEY; }
    function KEY_delete (line 491) | static void KEY_delete(KEY *key) { delete key; }
    function set_encrypt_key (line 493) | static void set_encrypt_key(const unsigned char *handle, const int bit...
    function set_decrypt_key (line 509) | static void set_decrypt_key(const unsigned char *handle, const int bit...
    function encrypt (line 525) | static void encrypt(unsigned char *src, unsigned char *dst, KEY *key) {
    function decrypt (line 539) | static void decrypt(unsigned char *src, unsigned char *dst, KEY *key) {
    function ecb_encrypt_blks (line 543) | static void ecb_encrypt_blks(block *blks, unsigned nblks, KEY *key) {
    function ecb_decrypt_blks (line 556) | static void ecb_decrypt_blks(block *blks, unsigned nblks, KEY *key) {
    type aes128_ctx (line 572) | struct aes128_ctx
    function KEY (line 574) | static KEY *KEY_new() { return new KEY; }
    function KEY_delete (line 576) | static void KEY_delete(KEY *key) { delete key; }
    function set_encrypt_key (line 578) | static void set_encrypt_key(const unsigned char *handle, const int bit...
    function set_decrypt_key (line 583) | static void set_decrypt_key(const unsigned char *handle, const int bit...
    function encrypt (line 588) | static void encrypt(unsigned char *src, unsigned char *dst, KEY *key) {
    function decrypt (line 593) | static void decrypt(unsigned char *src, unsigned char *dst, KEY *key) {
    function ecb_encrypt_blks (line 597) | static void ecb_encrypt_blks(block *blks, unsigned nblks, KEY *key) {
    function ecb_decrypt_blks (line 600) | static void ecb_decrypt_blks(block *blks, unsigned nblks, KEY *key) {
  type ocb_aes (line 570) | namespace ocb_aes {
    function KEY (line 375) | static KEY *KEY_new() {
    function KEY_delete (line 383) | static void KEY_delete(KEY *key) { EVP_CIPHER_CTX_free(key); }
    function set_encrypt_key (line 385) | static void set_encrypt_key(const unsigned char *user_key, int bits, K...
    function set_decrypt_key (line 405) | static void set_decrypt_key(const unsigned char *user_key, int bits, K...
    function encrypt (line 414) | static void encrypt(const unsigned char *in, unsigned char *out, KEY *...
    function decrypt (line 437) | static void decrypt(const unsigned char *in, unsigned char *out, KEY *...
    function ecb_encrypt_blks (line 458) | static void ecb_encrypt_blks(block *blks, unsigned nblks, KEY *key) {
    function ecb_decrypt_blks (line 465) | static void ecb_decrypt_blks(block *blks, unsigned nblks, KEY *key) {
    function KEY (line 489) | static KEY *KEY_new() { return new KEY; }
    function KEY_delete (line 491) | static void KEY_delete(KEY *key) { delete key; }
    function set_encrypt_key (line 493) | static void set_encrypt_key(const unsigned char *handle, const int bit...
    function set_decrypt_key (line 509) | static void set_decrypt_key(const unsigned char *handle, const int bit...
    function encrypt (line 525) | static void encrypt(unsigned char *src, unsigned char *dst, KEY *key) {
    function decrypt (line 539) | static void decrypt(unsigned char *src, unsigned char *dst, KEY *key) {
    function ecb_encrypt_blks (line 543) | static void ecb_encrypt_blks(block *blks, unsigned nblks, KEY *key) {
    function ecb_decrypt_blks (line 556) | static void ecb_decrypt_blks(block *blks, unsigned nblks, KEY *key) {
    type aes128_ctx (line 572) | struct aes128_ctx
    function KEY (line 574) | static KEY *KEY_new() { return new KEY; }
    function KEY_delete (line 576) | static void KEY_delete(KEY *key) { delete key; }
    function set_encrypt_key (line 578) | static void set_encrypt_key(const unsigned char *handle, const int bit...
    function set_decrypt_key (line 583) | static void set_decrypt_key(const unsigned char *handle, const int bit...
    function encrypt (line 588) | static void encrypt(unsigned char *src, unsigned char *dst, KEY *key) {
    function decrypt (line 593) | static void decrypt(unsigned char *src, unsigned char *dst, KEY *key) {
    function ecb_encrypt_blks (line 597) | static void ecb_encrypt_blks(block *blks, unsigned nblks, KEY *key) {
    function ecb_decrypt_blks (line 600) | static void ecb_decrypt_blks(block *blks, unsigned nblks, KEY *key) {
  type _ae_ctx (line 626) | struct _ae_ctx {
  function block (line 652) | static block getL(const ae_ctx *ctx, unsigned tz)
  function ae_clear (line 679) | int ae_clear (ae_ctx *ctx) /* Zero ae_ctx and undo initialization       ...
  function ae_ctx_sizeof (line 687) | int ae_ctx_sizeof(void) { return (int) sizeof(ae_ctx); }
  function ae_init (line 691) | int ae_init(ae_ctx *ctx, const void *key, int key_len, int nonce_len, in...
  function block (line 737) | static block gen_offset_from_nonce(ae_ctx *ctx, const void *nonce)
  function process_ad (line 763) | static void process_ad(ae_ctx *ctx, const void *ad, int ad_len, int final)
  function ae_encrypt (line 888) | int ae_encrypt(ae_ctx     *  ctx,
  function constant_time_memcmp (line 1087) | static int constant_time_memcmp(const void *av, const void *bv, size_t n) {
  function ae_decrypt (line 1102) | int ae_decrypt(ae_ctx     *ctx,
  function pbuf (line 1316) | static void pbuf(void *p, unsigned len, const void *s)
  function vectors (line 1326) | static void vectors(ae_ctx *ctx, int len)
  function validate (line 1341) | static void validate()
  function main (line 1450) | int main()

FILE: src/crypto/ocb_openssl.cc
  type _ae_ctx (line 8) | struct _ae_ctx
  function ae_clear (line 15) | int ae_clear( ae_ctx* ctx )
  function ae_ctx_sizeof (line 23) | int ae_ctx_sizeof()
  function ae_evp_cipher_init (line 30) | static int ae_evp_cipher_init( EVP_CIPHER_CTX** in_ctx,
  function ae_init (line 68) | int ae_init( ae_ctx* ctx, const void* key, int key_len, int nonce_len, i...
  function ae_encrypt (line 97) | int ae_encrypt( ae_ctx* ctx,
  function ae_decrypt (line 151) | int ae_decrypt( ae_ctx* ctx,

FILE: src/crypto/prng.h
  function class (line 66) | class PRNG

FILE: src/examples/benchmark.cc
  function main (line 67) | int main( int argc, char** argv )

FILE: src/examples/decrypt.cc
  function main (line 41) | int main( int argc, char* argv[] )

FILE: src/examples/encrypt.cc
  function main (line 41) | int main( int argc, char* argv[] )

FILE: src/examples/ntester.cc
  function main (line 46) | int main( int argc, char* argv[] )

FILE: src/examples/parse.cc
  function main (line 70) | int main( int argc __attribute__( ( unused ) ), char* argv[] __attribute...
  function emulate_terminal (line 138) | static void emulate_terminal( int fd )
  function copy (line 167) | static int copy( int src, int dest )
  function vt_parser (line 182) | static int vt_parser( int fd, Parser::UTF8Parser* parser )

FILE: src/examples/termemu.cc
  function main (line 76) | int main( int argc, char* argv[] )
  function tick (line 175) | static bool tick( Terminal::Framebuffer& state, Terminal::Framebuffer& n...
  function emulate_terminal (line 219) | static void emulate_terminal( int fd )

FILE: src/frontend/mosh-client.cc
  function print_version (line 74) | static void print_version( FILE* file )
  function print_usage (line 84) | static void print_usage( FILE* file, const char* argv0 )
  function print_colorcount (line 94) | static void print_colorcount( void )
  function main (line 108) | int main( int argc, char* argv[] )

FILE: src/frontend/mosh-server.cc
  function print_version (line 115) | static void print_version( FILE* file )
  function print_usage (line 125) | static void print_usage( FILE* stream, const char* argv0 )
  function spin (line 138) | static void spin( void )
  function get_SSH_IP (line 152) | static std::string get_SSH_IP( void )
  function main (line 178) | int main( int argc, char* argv[] )
  function run_server (line 385) | static int run_server( const char* desired_ip,
  function serve (line 678) | static void serve( int host_fd,
  function print_motd (line 968) | static bool print_motd( const char* filename )
  function chdir_homedir (line 993) | static void chdir_homedir( void )
  function motd_hushed (line 1014) | static bool motd_hushed( void )
  function device_exists (line 1022) | static bool device_exists( const char* ut_line )
  function warn_unattached (line 1030) | static void warn_unattached( const std::string& ignore_entry )

FILE: src/frontend/stmclient.cc
  type timespec (line 567) | struct timespec

FILE: src/frontend/stmclient.h
  function class (line 47) | class STMClient

FILE: src/frontend/terminaloverlay.cc
  function Validity (line 72) | Validity ConditionalOverlayCell::get_validity( const Framebuffer& fb,
  function Validity (line 114) | Validity ConditionalCursorMove::get_validity( const Framebuffer& fb,
  function human_readable_duration (line 160) | static std::string human_readable_duration( int num_seconds, const std::...
  function ConditionalOverlayRow (line 597) | ConditionalOverlayRow& PredictionEngine::get_or_make_row( int row_num, i...

FILE: src/frontend/terminaloverlay.h
  function namespace (line 44) | namespace Overlay {
  function class (line 86) | class ConditionalCursorMove : public ConditionalOverlay
  function class (line 100) | class ConditionalOverlayCell : public ConditionalOverlay
  function reset_with_orig (line 122) | void reset_with_orig( void )
  function class (line 134) | class ConditionalOverlayRow
  function class (line 148) | class NotificationEngine
  function set_escape_key_string (line 185) | void set_escape_key_string( const std::string& s_name )
  function set_network_error (line 192) | void set_network_error( const std::string& s )
  function clear_network_error (line 202) | void clear_network_error()
  function class (line 212) | class PredictionEngine
  function set_predict_overwrite (line 291) | void set_predict_overwrite( bool overwrite ) { predict_overwrite = overw...
  function set_local_frame_sent (line 299) | void set_local_frame_sent( uint64_t x ) { local_frame_sent = x; }
  function set_local_frame_acked (line 300) | void set_local_frame_acked( uint64_t x ) { local_frame_acked = x; }
  function set_local_frame_late_acked (line 301) | void set_local_frame_late_acked( uint64_t x ) { local_frame_late_acked =...
  function set_send_interval (line 303) | void set_send_interval( unsigned int x ) { send_interval = x; }
  function wait_time (line 305) | int wait_time( void ) const { return ( timing_tests_necessary() && activ...
  function class (line 315) | class TitleEngine
  function class (line 327) | class OverlayManager

FILE: src/fuzz/terminal_fuzzer.cc
  function LLVMFuzzerTestOneInput (line 7) | int LLVMFuzzerTestOneInput( const uint8_t* data, size_t size )

FILE: src/fuzz/terminal_parser_fuzzer.cc
  function LLVMFuzzerTestOneInput (line 6) | int LLVMFuzzerTestOneInput( const uint8_t* data, size_t size )

FILE: src/network/compressor.cc
  function Compressor (line 57) | Compressor& Network::get_compressor( void )

FILE: src/network/compressor.h
  function namespace (line 38) | namespace Network {

FILE: src/network/network.cc
  function Message (line 86) | Message Packet::toMessage( void )
  function Packet (line 98) | Packet Connection::new_packet( const std::string& s_payload )
  class AddrInfo (line 210) | class AddrInfo
    type addrinfo (line 213) | struct addrinfo
    method AddrInfo (line 214) | AddrInfo( const char* node, const char* service, const struct addrinfo...
  type addrinfo (line 278) | struct addrinfo
  type addrinfo (line 350) | struct addrinfo
  type msghdr (line 428) | struct msghdr
  type iovec (line 429) | struct iovec
  type cmsghdr (line 464) | struct cmsghdr

FILE: src/network/network.h
  function namespace (line 52) | namespace Network {

FILE: src/network/networktransport.h
  function namespace (line 46) | namespace Network {

FILE: src/network/transportfragment.cc
  function network_order_string (line 44) | static std::string network_order_string( uint16_t host_order )
  function network_order_string (line 50) | static std::string network_order_string( uint64_t host_order )
  function Instruction (line 129) | Instruction FragmentAssembly::get_assembly( void )

FILE: src/network/transportfragment.h
  function namespace (line 42) | namespace Network {

FILE: src/network/transportsender.h
  function namespace (line 45) | namespace Network {

FILE: src/statesync/completeterminal.cc
  function string (line 44) | string Complete::act( const string& str )
  function string (line 61) | string Complete::act( const Action& act )
  function string (line 69) | string Complete::diff_from( const Complete& existing ) const
  function string (line 96) | string Complete::init_diff( void ) const

FILE: src/statesync/completeterminal.h
  function namespace (line 44) | namespace Terminal {

FILE: src/statesync/user.h
  function namespace (line 43) | namespace Network {

FILE: src/terminal/parser.cc
  function append_or_delete (line 43) | static void append_or_delete( Parser::ActionPointer act, Parser::Actions...

FILE: src/terminal/parser.h
  function namespace (line 47) | namespace Parser {

FILE: src/terminal/parseraction.h
  function namespace (line 40) | namespace Terminal {
  function namespace (line 44) | namespace Parser {

FILE: src/terminal/parserstate.cc
  function Transition (line 40) | Transition State::anywhere_rule( wchar_t ch ) const
  function Transition (line 62) | Transition State::input( wchar_t ch ) const
  function C0_prime (line 79) | static bool C0_prime( wchar_t ch )
  function GLGR (line 84) | static bool GLGR( wchar_t ch )
  function Transition (line 90) | Transition Ground::input_state_rule( wchar_t ch ) const
  function ActionPointer (line 103) | ActionPointer Escape::enter( void ) const
  function Transition (line 108) | Transition Escape::input_state_rule( wchar_t ch ) const
  function Transition (line 142) | Transition Escape_Intermediate::input_state_rule( wchar_t ch ) const
  function ActionPointer (line 159) | ActionPointer CSI_Entry::enter( void ) const
  function Transition (line 164) | Transition CSI_Entry::input_state_rule( wchar_t ch ) const
  function Transition (line 193) | Transition CSI_Param::input_state_rule( wchar_t ch ) const
  function Transition (line 218) | Transition CSI_Intermediate::input_state_rule( wchar_t ch ) const
  function Transition (line 239) | Transition CSI_Ignore::input_state_rule( wchar_t ch ) const
  function ActionPointer (line 252) | ActionPointer DCS_Entry::enter( void ) const
  function Transition (line 257) | Transition DCS_Entry::input_state_rule( wchar_t ch ) const
  function Transition (line 282) | Transition DCS_Param::input_state_rule( wchar_t ch ) const
  function Transition (line 303) | Transition DCS_Intermediate::input_state_rule( wchar_t ch ) const
  function ActionPointer (line 320) | ActionPointer DCS_Passthrough::enter( void ) const
  function ActionPointer (line 325) | ActionPointer DCS_Passthrough::exit( void ) const
  function Transition (line 330) | Transition DCS_Passthrough::input_state_rule( wchar_t ch ) const
  function Transition (line 343) | Transition DCS_Ignore::input_state_rule( wchar_t ch ) const
  function ActionPointer (line 352) | ActionPointer OSC_String::enter( void ) const
  function ActionPointer (line 357) | ActionPointer OSC_String::exit( void ) const
  function Transition (line 362) | Transition OSC_String::input_state_rule( wchar_t ch ) const
  function Transition (line 375) | Transition SOS_PM_APC_String::input_state_rule( wchar_t ch ) const

FILE: src/terminal/parserstate.h
  function namespace (line 38) | namespace Parser {
  function class (line 63) | class Ground : public State
  function class (line 68) | class Escape : public State
  function class (line 74) | class Escape_Intermediate : public State
  function class (line 79) | class CSI_Entry : public State
  function class (line 84) | class CSI_Param : public State
  function class (line 88) | class CSI_Intermediate : public State
  function class (line 92) | class CSI_Ignore : public State
  function class (line 97) | class DCS_Entry : public State
  function class (line 102) | class DCS_Param : public State
  function class (line 106) | class DCS_Intermediate : public State
  function class (line 110) | class DCS_Passthrough : public State
  function class (line 116) | class DCS_Ignore : public State
  function class (line 121) | class OSC_String : public State
  function class (line 127) | class SOS_PM_APC_String : public State

FILE: src/terminal/parserstatefamily.h
  function namespace (line 38) | namespace Parser {

FILE: src/terminal/parsertransition.h
  function class (line 43) | class Transition

FILE: src/terminal/terminal.h
  function namespace (line 47) | namespace Terminal {

FILE: src/terminal/terminaldispatcher.cc
  function DispatchRegistry (line 167) | DispatchRegistry& Terminal::get_global_dispatch_registry( void )
  function register_function (line 173) | static void register_function( Function_Type type, const std::string& di...

FILE: src/terminal/terminaldispatcher.h
  function namespace (line 40) | namespace Parser {
  function namespace (line 53) | namespace Terminal {

FILE: src/terminal/terminaldisplay.cc
  function Renditions (line 42) | static const Renditions& initial_rendition( void )

FILE: src/terminal/terminaldisplay.h
  function namespace (line 38) | namespace Terminal {

FILE: src/terminal/terminaldisplayinit.cc
  function ti_flag (line 65) | static bool ti_flag( const char* capname )

FILE: src/terminal/terminalframebuffer.cc
  function Framebuffer (line 91) | Framebuffer& Framebuffer::operator=( const Framebuffer& other )
  function Cell (line 190) | Cell* Framebuffer::get_combining_cell( void )

FILE: src/terminal/terminalframebuffer.h
  function namespace (line 47) | namespace Terminal {
  function set_title_initialized (line 461) | void set_title_initialized( void ) { title_initialized = true; }
  function is_title_initialized (line 462) | bool is_title_initialized( void ) const { return title_initialized; }
  function set_icon_name (line 463) | void set_icon_name( const title_type& s ) { icon_name = s; }
  function set_window_title (line 464) | void set_window_title( const title_type& s ) { window_title = s; }
  function set_clipboard (line 465) | void set_clipboard( const title_type& s ) { clipboard = s; }
  function title_type (line 466) | const title_type& get_icon_name( void ) const { return icon_name; }
  function title_type (line 467) | const title_type& get_window_title( void ) const { return window_title; }
  function title_type (line 468) | const title_type& get_clipboard( void ) const { return clipboard; }
  function reset_cell (line 474) | void reset_cell( Cell* c ) { c->reset( ds.get_background_rendition() ); }
  function reset_row (line 475) | void reset_row( Row* r ) { r->reset( ds.get_background_rendition() ); }
  function ring_bell (line 477) | void ring_bell( void ) { bell_count++; }
  function get_bell_count (line 478) | unsigned int get_bell_count( void ) const { return bell_count; }

FILE: src/terminal/terminalfunctions.cc
  function clearline (line 47) | static void clearline( Framebuffer* fb, int row, int start, int end )
  function CSI_EL (line 55) | static void CSI_EL( Framebuffer* fb, Dispatcher* dispatch )
  function CSI_ED (line 75) | static void CSI_ED( Framebuffer* fb, Dispatcher* dispatch )
  function CSI_cursormove (line 103) | static void CSI_cursormove( Framebuffer* fb, Dispatcher* dispatch )
  function CSI_DA (line 138) | static void CSI_DA( Framebuffer* fb __attribute( ( unused ) ), Dispatche...
  function CSI_SDA (line 146) | static void CSI_SDA( Framebuffer* fb __attribute( ( unused ) ), Dispatch...
  function Esc_DECALN (line 154) | static void Esc_DECALN( Framebuffer* fb, Dispatcher* dispatch __attribut...
  function Ctrl_LF (line 167) | static void Ctrl_LF( Framebuffer* fb, Dispatcher* dispatch __attribute( ...
  function Ctrl_CR (line 179) | static void Ctrl_CR( Framebuffer* fb, Dispatcher* dispatch __attribute( ...
  function Ctrl_BS (line 187) | static void Ctrl_BS( Framebuffer* fb, Dispatcher* dispatch __attribute( ...
  function Ctrl_RI (line 195) | static void Ctrl_RI( Framebuffer* fb, Dispatcher* dispatch __attribute( ...
  function Ctrl_NEL (line 203) | static void Ctrl_NEL( Framebuffer* fb, Dispatcher* dispatch __attribute(...
  function HT_n (line 212) | static void HT_n( Framebuffer* fb, size_t count )
  function Ctrl_HT (line 227) | static void Ctrl_HT( Framebuffer* fb, Dispatcher* dispatch __attribute( ...
  function CSI_CxT (line 233) | static void CSI_CxT( Framebuffer* fb, Dispatcher* dispatch )
  function Ctrl_HTS (line 249) | static void Ctrl_HTS( Framebuffer* fb, Dispatcher* dispatch __attribute(...
  function CSI_TBC (line 257) | static void CSI_TBC( Framebuffer* fb, Dispatcher* dispatch )
  function set_if_available (line 314) | static void set_if_available( bool* mode, bool value )
  function CSI_DECSM (line 322) | static void CSI_DECSM( Framebuffer* fb, Dispatcher* dispatch )
  function CSI_DECRM (line 337) | static void CSI_DECRM( Framebuffer* fb, Dispatcher* dispatch )
  function CSI_SM (line 364) | static void CSI_SM( Framebuffer* fb, Dispatcher* dispatch )
  function CSI_RM (line 375) | static void CSI_RM( Framebuffer* fb, Dispatcher* dispatch )
  function CSI_DECSTBM (line 389) | static void CSI_DECSTBM( Framebuffer* fb, Dispatcher* dispatch )
  function Ctrl_BEL (line 406) | static void Ctrl_BEL( Framebuffer* fb, Dispatcher* dispatch __attribute(...
  function CSI_SGR (line 414) | static void CSI_SGR( Framebuffer* fb, Dispatcher* dispatch )
  function Esc_DECSC (line 456) | static void Esc_DECSC( Framebuffer* fb, Dispatcher* dispatch __attribute...
  function Esc_DECRC (line 461) | static void Esc_DECRC( Framebuffer* fb, Dispatcher* dispatch __attribute...
  function CSI_DSR (line 470) | static void CSI_DSR( Framebuffer* fb, Dispatcher* dispatch )
  function CSI_IL (line 491) | static void CSI_IL( Framebuffer* fb, Dispatcher* dispatch )
  function CSI_DL (line 505) | static void CSI_DL( Framebuffer* fb, Dispatcher* dispatch )
  function CSI_ICH (line 519) | static void CSI_ICH( Framebuffer* fb, Dispatcher* dispatch )
  function CSI_DCH (line 531) | static void CSI_DCH( Framebuffer* fb, Dispatcher* dispatch )
  function CSI_VPA (line 543) | static void CSI_VPA( Framebuffer* fb, Dispatcher* dispatch )
  function CSI_HPA (line 552) | static void CSI_HPA( Framebuffer* fb, Dispatcher* dispatch )
  function CSI_ECH (line 562) | static void CSI_ECH( Framebuffer* fb, Dispatcher* dispatch )
  function Esc_RIS (line 576) | static void Esc_RIS( Framebuffer* fb, Dispatcher* dispatch __attribute( ...
  function CSI_DECSTR (line 584) | static void CSI_DECSTR( Framebuffer* fb, Dispatcher* dispatch __attribut...
  function CSI_SD (line 632) | static void CSI_SD( Framebuffer* fb, Dispatcher* dispatch )
  function CSI_SU (line 640) | static void CSI_SU( Framebuffer* fb, Dispatcher* dispatch )

FILE: src/terminal/terminaluserinput.h
  function namespace (line 39) | namespace Terminal {

FILE: src/tests/base64.cc
  function test_base64 (line 57) | static void test_base64( void )
  function main (line 133) | int main( int argc, char* argv[] )

FILE: src/tests/base64_vector.h
  type base64_test_row (line 1) | struct base64_test_row
  type base64_test_row (line 6) | typedef base64_test_row* base64_test_vector;

FILE: src/tests/encrypt-decrypt.cc
  function random_payload (line 59) | static std::string random_payload( void )
  function test_bad_decrypt (line 69) | static void test_bad_decrypt( Session& decryption_session )
  function test_one_session (line 91) | static void test_one_session( void )
  function main (line 139) | int main( int argc, char* argv[] )

FILE: src/tests/inpty.cc
  function main (line 59) | int main( int argc, char* argv[] )

FILE: src/tests/is-utf8-locale.cc
  function main (line 37) | int main( int argc __attribute__( ( unused ) ), char** argv __attribute_...

FILE: src/tests/nonce-incr.cc
  function main (line 41) | int main()

FILE: src/tests/ocb-aes.cc
  function equal (line 59) | static bool equal( const AlignedBuffer& a, const AlignedBuffer& b )
  function AlignedBuffer (line 66) | static AlignedBuffer* get_ctx( const AlignedBuffer& key )
  function scrap_ctx (line 74) | static void scrap_ctx( AlignedBuffer& ctx_buf )
  function test_encrypt (line 79) | static void test_encrypt( const AlignedBuffer& key,
  function test_decrypt (line 111) | static void test_decrypt( const AlignedBuffer& key,
  function test_vector (line 150) | static void test_vector( const char* key_p,
  function test_all_vectors (line 194) | static void test_all_vectors( void )
  function test_iterative (line 504) | static void test_iterative( void )
  function main (line 566) | int main( int argc, char* argv[] )

FILE: src/tests/test_utils.cc
  function hexdump (line 37) | void hexdump( const void* buf, size_t len, const char* name )
  function hexdump (line 50) | void hexdump( const Crypto::AlignedBuffer& buf, const char* name )
  function hexdump (line 55) | void hexdump( const std::string& buf, const char* name )

FILE: src/util/dos_assert.h
  function dos_detected (line 41) | static void dos_detected( const char* expression, const char* file, int ...

FILE: src/util/fatal_assert.h
  function fatal_error (line 39) | static void fatal_error( const char* expression, const char* file, int l...

FILE: src/util/locale_utils.cc
  function LocaleVar (line 56) | const LocaleVar get_ctype( void )
  function is_utf8_locale (line 83) | bool is_utf8_locale( void )
  function set_native_locale (line 92) | void set_native_locale( void )
  function clear_locale_variables (line 110) | void clear_locale_variables( void )

FILE: src/util/locale_utils.h
  function class (line 38) | class LocaleVar

FILE: src/util/pty_compat.cc
  function pid_t (line 49) | pid_t my_forkpty( int* amaster, char* name, const struct termios* termp,...
  function my_cfmakeraw (line 170) | void my_cfmakeraw( struct termios* termios_p )

FILE: src/util/pty_compat.h
  type termios (line 45) | struct termios
  type winsize (line 45) | struct winsize
  type termios (line 47) | struct termios

FILE: src/util/select.h
  function class (line 51) | class Select

FILE: src/util/swrite.cc
  function swrite (line 40) | int swrite( int fd, const char* str, ssize_t len )

FILE: src/util/timestamp.cc
  function frozen_timestamp (line 63) | uint64_t frozen_timestamp( void )
  function freeze_timestamp (line 72) | void freeze_timestamp( void )
Condensed preview — 215 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (960K chars).
[
  {
    "path": ".clang-format",
    "chars": 569,
    "preview": "---\nLanguage: Cpp\nBasedOnStyle: Mozilla\nColumnLimit: 116\nSpacesInParentheses: true\nAlwaysBreakAfterReturnType: None\nAlwa"
  },
  {
    "path": ".gitattributes",
    "chars": 12,
    "preview": "* text=true\n"
  },
  {
    "path": ".github/workflows/ci.yml",
    "chars": 1055,
    "preview": "name: ci\n\non: [push, pull_request]\n\njobs:\n  build:\n    runs-on: ${{ matrix.os }}\n\n    strategy:\n      matrix:\n        os"
  },
  {
    "path": ".github/workflows/cifuzz.yml",
    "chars": 693,
    "preview": "name: CIFuzz\non: [pull_request]\njobs:\n  Fuzzing:\n    runs-on: ubuntu-latest\n    steps:\n    - name: Build Fuzzers\n      i"
  },
  {
    "path": ".github/workflows/clang-format.yml",
    "chars": 270,
    "preview": "name: clang-format-lint\n\non: [pull_request]\n\njobs:\n  build:\n    runs-on: ubuntu-latest\n\n    steps:\n    - uses: actions/c"
  },
  {
    "path": ".github/workflows/release.yml",
    "chars": 4333,
    "preview": "name: Release\n\non:\n  push:\n    tags:\n      # This syntax is globs, not regex, so it's matching any tag that\n      # cont"
  },
  {
    "path": ".gitignore",
    "chars": 493,
    "preview": "*.a\n*.o\n*.pb.cc\n*.pb.h\n*~\n.deps\nMakefile\nMakefile.in\n.cproject\n.project\ncompile_commands.json\naminclude_static.am\n\n# Cov"
  },
  {
    "path": "AUTHORS",
    "chars": 110,
    "preview": "Keith Winstein <mosh-devel@mit.edu>\nAnders Kaseorg\nQuentin Smith\nRichard Tibbetts\nKeegan McAllister\nJohn Hood\n"
  },
  {
    "path": "COPYING",
    "chars": 35147,
    "preview": "                    GNU GENERAL PUBLIC LICENSE\n                       Version 3, 29 June 2007\n\n Copyright (C) 2007 Free "
  },
  {
    "path": "COPYING.iOS",
    "chars": 755,
    "preview": "The Mosh developers are aware that the terms of service that apply to\napps distributed via Apple's App Store services ma"
  },
  {
    "path": "ChangeLog",
    "chars": 16493,
    "preview": "2017-07-21 Keith Winstein <mosh-devel@mit.edu>\n\n\t* Version 1.3.2 released.\n\n\t* Platform support:\n\t\t* Explicitly enable b"
  },
  {
    "path": "Makefile.am",
    "chars": 2643,
    "preview": "# Work around inconsistency in AX_CODE_COVERAGE defining\n# AM_DISTCHECK_CONFIGURE_FLAGS only in some branches\nif !CODE_C"
  },
  {
    "path": "NEWS",
    "chars": 472,
    "preview": "2012-04-26\n----------\n\n* Version 1.2 released\n\n2012-03-22\n----------\n\n* Version 1.1 released\n\n2012-03-12\n----------\n\n* V"
  },
  {
    "path": "README.md",
    "chars": 7990,
    "preview": "[![ci](https://github.com/mobile-shell/mosh/actions/workflows/ci.yml/badge.svg)](https://github.com/mobile-shell/mosh/ac"
  },
  {
    "path": "THANKS",
    "chars": 1224,
    "preview": "* Hari Balakrishnan, who advised this work and came up with the name.\n\n* Paul Williams (www.vt100.net), whose reverse-en"
  },
  {
    "path": "autogen.sh",
    "chars": 31,
    "preview": "#!/bin/sh\n\nexec autoreconf -fi\n"
  },
  {
    "path": "build-package.sh",
    "chars": 84,
    "preview": "#!/bin/sh\n\ngbp buildpackage --git-upstream-branch=master --git-upstream-tree=branch\n"
  },
  {
    "path": "build-source-package.sh",
    "chars": 87,
    "preview": "#!/bin/sh\n\ngbp buildpackage --git-upstream-branch=master --git-upstream-tree=branch -S\n"
  },
  {
    "path": "conf/Makefile.am",
    "chars": 247,
    "preview": "completionsdir = @completions@\ndist_completions_DATA =\nnobase_dist_sysconf_DATA =\n\nif INSTALL_UFW\n  nobase_dist_sysconf_"
  },
  {
    "path": "conf/bash-completion/completions/mosh",
    "chars": 818,
    "preview": "# Bash completions for Mosh, the mobile shell.         -*- shell-script -*-\n\n__mosh_init_completion()\n{\n    if declare -"
  },
  {
    "path": "conf/ufw/applications.d/mosh",
    "chars": 129,
    "preview": "[mosh]\ntitle=Mosh (mobile shell)\ndescription=Mobile shell that supports roaming and intelligent local echo\nports=60000:6"
  },
  {
    "path": "configure.ac",
    "chars": 22242,
    "preview": "#                                               -*- Autoconf -*-\n# Process this file with autoconf to produce a configur"
  },
  {
    "path": "debian/changelog",
    "chars": 27850,
    "preview": "mosh (1.4.0-2) UNRELEASED; urgency=medium\n\n  * Remove Benjamin Barenblat from Uploaders.\n\n -- Benjamin Barenblat <bbaren"
  },
  {
    "path": "debian/control",
    "chars": 1065,
    "preview": "Source: mosh\nSection: net\nPriority: optional\nMaintainer: Keith Winstein <keithw@mit.edu>\nUploaders: Alex Chernyakhovsky "
  },
  {
    "path": "debian/copyright",
    "chars": 6039,
    "preview": "Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/\nUpstream-Name: mosh\nSource: https://github.com"
  },
  {
    "path": "debian/docs",
    "chars": 10,
    "preview": "README.md\n"
  },
  {
    "path": "debian/mosh.maintscript",
    "chars": 47,
    "preview": "rm_conffile /etc/bash_completion.d/mosh 1.2.5~\n"
  },
  {
    "path": "debian/rules",
    "chars": 922,
    "preview": "#!/usr/bin/make -f\n# -*- makefile -*-\n# Sample debian/rules that uses debhelper.\n# This file was originally written by J"
  },
  {
    "path": "debian/source/format",
    "chars": 12,
    "preview": "3.0 (quilt)\n"
  },
  {
    "path": "debian/watch",
    "chars": 183,
    "preview": "version=4\nopts=\"filenamemangle=s%(?:.*?)?v?(\\d[\\d.]*)\\.tar\\.gz%@PACKAGE@-$1.tar.gz%\" \\\n    https://github.com/mobile-she"
  },
  {
    "path": "fedora/mosh.spec",
    "chars": 2647,
    "preview": "Name:\t\tmosh\nVersion:\t1.2.5\nRelease:\t1%{?dist}\nSummary:\tMobile shell that supports roaming and intelligent local echo\n\nLi"
  },
  {
    "path": "m4/ax_ac_append_to_file.m4",
    "chars": 914,
    "preview": "# ===========================================================================\n#   https://www.gnu.org/software/autoconf-"
  },
  {
    "path": "m4/ax_ac_print_to_file.m4",
    "chars": 905,
    "preview": "# ===========================================================================\n#   https://www.gnu.org/software/autoconf-"
  },
  {
    "path": "m4/ax_add_am_macro_static.m4",
    "chars": 853,
    "preview": "# ===========================================================================\n#  https://www.gnu.org/software/autoconf-a"
  },
  {
    "path": "m4/ax_am_macros_static.m4",
    "chars": 1109,
    "preview": "# ===========================================================================\n#   https://www.gnu.org/software/autoconf-"
  },
  {
    "path": "m4/ax_check_compile_flag.m4",
    "chars": 3241,
    "preview": "# ===========================================================================\n#   http://www.gnu.org/software/autoconf-a"
  },
  {
    "path": "m4/ax_check_gnu_make.m4",
    "chars": 4055,
    "preview": "# ===========================================================================\n#    https://www.gnu.org/software/autoconf"
  },
  {
    "path": "m4/ax_check_library.m4",
    "chars": 3793,
    "preview": "# ===========================================================================\n#     http://www.gnu.org/software/autoconf"
  },
  {
    "path": "m4/ax_check_link_flag.m4",
    "chars": 3056,
    "preview": "# ===========================================================================\n#    http://www.gnu.org/software/autoconf-"
  },
  {
    "path": "m4/ax_code_coverage.m4",
    "chars": 12174,
    "preview": "# ===========================================================================\n#     https://www.gnu.org/software/autocon"
  },
  {
    "path": "m4/ax_cxx_compile_stdcxx.m4",
    "chars": 19246,
    "preview": "# ===========================================================================\n#  https://www.gnu.org/software/autoconf-a"
  },
  {
    "path": "m4/ax_file_escapes.m4",
    "chars": 763,
    "preview": "# ===========================================================================\n#     https://www.gnu.org/software/autocon"
  },
  {
    "path": "m4/ax_require_defined.m4",
    "chars": 1218,
    "preview": "# ===========================================================================\n#    https://www.gnu.org/software/autoconf"
  },
  {
    "path": "m4/ax_with_curses.m4",
    "chars": 25051,
    "preview": "# ===========================================================================\n#      http://www.gnu.org/software/autocon"
  },
  {
    "path": "m4/pkg.m4",
    "chars": 5650,
    "preview": "# pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-\n# serial 1 (pkg-config-0.24)\n# \n# Copyri"
  },
  {
    "path": "macosx/.gitignore",
    "chars": 67,
    "preview": "/mosh-package.pmdoc\n/Mosh*.pkg\n/prefix*/\n/Distribution\n/Resources/\n"
  },
  {
    "path": "macosx/Distribution.in",
    "chars": 743,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"no\"?>\n<installer-script minSpecVersion=\"1.000000\" authoringTool=\"com.ap"
  },
  {
    "path": "macosx/brew-deps.sh",
    "chars": 1750,
    "preview": "#!/bin/sh\n\n#\n# Install Homebrew dependencies\n#\n# This script handles build dependencies other than those provided by\n# M"
  },
  {
    "path": "macosx/build.sh",
    "chars": 4858,
    "preview": "#!/bin/bash\n\n#\n# This script is known to work on:\n# OS X 10.5.8, Xcode 3.1.2, SDK 10.5, MacPorts 2.3.3\n# OS X 10.9.5, Xc"
  },
  {
    "path": "macosx/copying.rtf",
    "chars": 35387,
    "preview": "{\\rtf1\\ansi\\ansicpg1252\\cocoartf1138\\cocoasubrtf320\n{\\fonttbl\\f0\\fnil\\fcharset0 LucidaGrande;}\n{\\colortbl;\\red255\\green2"
  },
  {
    "path": "macosx/gtar",
    "chars": 50,
    "preview": "#!/bin/sh\nexec sudo /usr/local/bin/gtar.orig \"$@\"\n"
  },
  {
    "path": "macosx/mosh-package.pmdoc.in/01prefix-contents.xml",
    "chars": 1514,
    "preview": "<pkg-contents spec=\"1.12\">\n  <f n=\"prefix\" o=\"root\" g=\"wheel\" p=\"16877\" pt=\"prefix\" m=\"false\" t=\"file\">\n    <f n=\"local\""
  },
  {
    "path": "macosx/mosh-package.pmdoc.in/01prefix.xml",
    "chars": 1003,
    "preview": "<pkgref spec=\"1.12\" uuid=\"38E2F0D0-8573-4E7B-8A50-A86056DD0EE8\">\n    <config>\n        <identifier>edu.mit.mosh.mosh.pkg<"
  },
  {
    "path": "macosx/mosh-package.pmdoc.in/index.xml",
    "chars": 1278,
    "preview": "<pkmkdoc spec=\"1.12\">\n    <properties>\n        <title>Mosh $PACKAGE_VERSION</title>\n        <build>Mosh.pkg</build>\n    "
  },
  {
    "path": "macosx/osx-xcode.sh",
    "chars": 904,
    "preview": "#!/bin/sh\n\n#\n# OS X and Xcode support script.\n#\n\n#\n# Describe the OS X and Xcode installation, patches, etc as best as p"
  },
  {
    "path": "macosx/port-deps.sh",
    "chars": 554,
    "preview": "describe() {\n    /opt/local/bin/port version > port-version.txt\n    /opt/local/bin/port -v -q installed > port-packages."
  },
  {
    "path": "macosx/readme.rtf",
    "chars": 6997,
    "preview": "{\\rtf1\\ansi\\ansicpg1252\\cocoartf1138\\cocoasubrtf320\n{\\fonttbl\\f0\\fswiss\\fcharset0 Helvetica;\\f1\\fmodern\\fcharset0 Courie"
  },
  {
    "path": "man/Makefile.am",
    "chars": 135,
    "preview": "dist_man_MANS =\n\nif BUILD_CLIENT\n  dist_man_MANS += mosh.1 mosh-client.1\nendif\n\nif BUILD_SERVER\n  dist_man_MANS += mosh-"
  },
  {
    "path": "man/mosh-client.1",
    "chars": 2787,
    "preview": ".\\\"                                      Hey, EMACS: -*- nroff -*-\n.\\\" First parameter, NAME, should be all caps\n.\\\" Sec"
  },
  {
    "path": "man/mosh-server.1",
    "chars": 4641,
    "preview": ".\\\"                                      Hey, EMACS: -*- nroff -*-\n.\\\" First parameter, NAME, should be all caps\n.\\\" Sec"
  },
  {
    "path": "man/mosh.1",
    "chars": 11932,
    "preview": ".\\\"                                      Hey, EMACS: -*- nroff -*-\n.\\\" First parameter, NAME, should be all caps\n.\\\" Sec"
  },
  {
    "path": "ocb-license.html",
    "chars": 2160,
    "preview": "<TITLE>OCB - An Authenticated-Encryption Scheme - GPL Patent Grant - Rogaway</TITLE>\n\n<body bgcolor=\"#FFFFFF\">\n<H2><a na"
  },
  {
    "path": "scripts/Makefile.am",
    "chars": 338,
    "preview": "EXTRA_DIST = wrap-compiler-for-flag-check mosh.pl\nif BUILD_CLIENT\n  bin_SCRIPTS = mosh\nendif\nCLEANFILES = $(bin_SCRIPTS)"
  },
  {
    "path": "scripts/mosh.pl",
    "chars": 16445,
    "preview": "#!/usr/bin/env perl\n\n#   Mosh: the mobile shell\n#   Copyright 2012 Keith Winstein\n#\n#   This program is free software: y"
  },
  {
    "path": "scripts/wrap-compiler-for-flag-check",
    "chars": 501,
    "preview": "#!/bin/sh\n\n# There is no way to make clang's \"argument unused\" warning fatal.  So when\n# configure checks for supported "
  },
  {
    "path": "src/Makefile.am",
    "chars": 96,
    "preview": "SUBDIRS = include protobufs util crypto terminal network statesync frontend examples tests fuzz\n"
  },
  {
    "path": "src/crypto/Makefile.am",
    "chars": 424,
    "preview": "AM_CPPFLAGS = -I$(top_srcdir)/ $(CRYPTO_CFLAGS)\nAM_CXXFLAGS = $(WARNING_CXXFLAGS) $(PICKY_CXXFLAGS) $(HARDEN_CFLAGS) $(M"
  },
  {
    "path": "src/crypto/ae.h",
    "chars": 7555,
    "preview": "/* ---------------------------------------------------------------------------\n *\n * AEAD API 0.12 - 13 July 2011\n *\n * "
  },
  {
    "path": "src/crypto/base64.cc",
    "chars": 4938,
    "preview": "/*\n    Mosh: the mobile shell\n    Copyright 2012 Keith Winstein\n\n    This program is free software: you can redistribute"
  },
  {
    "path": "src/crypto/base64.h",
    "chars": 1680,
    "preview": "/*\n    Mosh: the mobile shell\n    Copyright 2012 Keith Winstein\n\n    This program is free software: you can redistribute"
  },
  {
    "path": "src/crypto/byteorder.h",
    "chars": 3785,
    "preview": "/*\n    Mosh: the mobile shell\n    Copyright 2012 Keith Winstein\n\n    This program is free software: you can redistribute"
  },
  {
    "path": "src/crypto/crypto.cc",
    "chars": 9235,
    "preview": "/*\n    Mosh: the mobile shell\n    Copyright 2012 Keith Winstein\n\n    This program is free software: you can redistribute"
  },
  {
    "path": "src/crypto/crypto.h",
    "chars": 4388,
    "preview": "/*\n    Mosh: the mobile shell\n    Copyright 2012 Keith Winstein\n\n    This program is free software: you can redistribute"
  },
  {
    "path": "src/crypto/ocb_internal.cc",
    "chars": 50110,
    "preview": "/*------------------------------------------------------------------------\n/ OCB Version 3 Reference Code (Optimized C) "
  },
  {
    "path": "src/crypto/ocb_openssl.cc",
    "chars": 6974,
    "preview": "#include \"src/crypto/ae.h\"\n#include \"src/include/config.h\"\n\n#include <cstring>\n#include <openssl/crypto.h>\n#include <ope"
  },
  {
    "path": "src/crypto/prng.h",
    "chars": 3380,
    "preview": "/*\n    Mosh: the mobile shell\n    Copyright 2012 Keith Winstein\n\n    This program is free software: you can redistribute"
  },
  {
    "path": "src/examples/.gitignore",
    "chars": 54,
    "preview": "/decrypt\n/encrypt\n/ntester\n/parse\n/termemu\n/benchmark\n"
  },
  {
    "path": "src/examples/Makefile.am",
    "chars": 1857,
    "preview": "AM_CXXFLAGS = -I$(top_srcdir)/ $(WARNING_CXXFLAGS) $(PICKY_CXXFLAGS) $(HARDEN_CFLAGS) $(MISC_CXXFLAGS)\nAM_LDFLAGS  = $(H"
  },
  {
    "path": "src/examples/benchmark.cc",
    "chars": 3949,
    "preview": "/*\n    Mosh: the mobile shell\n    Copyright 2012 Keith Winstein\n\n    This program is free software: you can redistribute"
  },
  {
    "path": "src/examples/decrypt.cc",
    "chars": 2158,
    "preview": "/*\n    Mosh: the mobile shell\n    Copyright 2012 Keith Winstein\n\n    This program is free software: you can redistribute"
  },
  {
    "path": "src/examples/encrypt.cc",
    "chars": 2206,
    "preview": "/*\n    Mosh: the mobile shell\n    Copyright 2012 Keith Winstein\n\n    This program is free software: you can redistribute"
  },
  {
    "path": "src/examples/ntester.cc",
    "chars": 5125,
    "preview": "/*\n    Mosh: the mobile shell\n    Copyright 2012 Keith Winstein\n\n    This program is free software: you can redistribute"
  },
  {
    "path": "src/examples/parse.cc",
    "chars": 5661,
    "preview": "/*\n    Mosh: the mobile shell\n    Copyright 2012 Keith Winstein\n\n    This program is free software: you can redistribute"
  },
  {
    "path": "src/examples/termemu.cc",
    "chars": 8921,
    "preview": "/*\n    Mosh: the mobile shell\n    Copyright 2012 Keith Winstein\n\n    This program is free software: you can redistribute"
  },
  {
    "path": "src/frontend/.gitignore",
    "chars": 26,
    "preview": "/mosh-client\n/mosh-server\n"
  },
  {
    "path": "src/frontend/Makefile.am",
    "chars": 763,
    "preview": "AM_CPPFLAGS = -I$(top_srcdir)/ $(TINFO_CFLAGS) $(protobuf_CFLAGS) $(CRYPTO_CFLAGS)\nAM_CXXFLAGS = $(WARNING_CXXFLAGS) $(P"
  },
  {
    "path": "src/frontend/mosh-client.cc",
    "chars": 6099,
    "preview": "/*\n    Mosh: the mobile shell\n    Copyright 2012 Keith Winstein\n\n    This program is free software: you can redistribute"
  },
  {
    "path": "src/frontend/mosh-server.cc",
    "chars": 33251,
    "preview": "/*\n    Mosh: the mobile shell\n    Copyright 2012 Keith Winstein\n\n    This program is free software: you can redistribute"
  },
  {
    "path": "src/frontend/stmclient.cc",
    "chars": 19248,
    "preview": "/*\n    Mosh: the mobile shell\n    Copyright 2012 Keith Winstein\n\n    This program is free software: you can redistribute"
  },
  {
    "path": "src/frontend/stmclient.h",
    "chars": 4771,
    "preview": "/*\n    Mosh: the mobile shell\n    Copyright 2012 Keith Winstein\n\n    This program is free software: you can redistribute"
  },
  {
    "path": "src/frontend/terminaloverlay.cc",
    "chars": 28310,
    "preview": "/*\n    Mosh: the mobile shell\n    Copyright 2012 Keith Winstein\n\n    This program is free software: you can redistribute"
  },
  {
    "path": "src/frontend/terminaloverlay.h",
    "chars": 10705,
    "preview": "/*\n    Mosh: the mobile shell\n    Copyright 2012 Keith Winstein\n\n    This program is free software: you can redistribute"
  },
  {
    "path": "src/fuzz/Makefile.am",
    "chars": 666,
    "preview": "AM_CXXFLAGS = $(WARNING_CXXFLAGS) $(PICKY_CXXFLAGS) $(HARDEN_CFLAGS) $(MISC_CXXFLAGS) $(CODE_COVERAGE_CXXFLAGS) $(FUZZIN"
  },
  {
    "path": "src/fuzz/terminal_corpus/3a52ce780950d4d969792a2559cd519d7ee8c727",
    "chars": 1,
    "preview": "."
  },
  {
    "path": "src/fuzz/terminal_corpus/433f367f36f48f78570c2013fef7a4f4b52b7c0c",
    "chars": 4,
    "preview": "&\u000e:#"
  },
  {
    "path": "src/fuzz/terminal_corpus/7c4d33785daa5c2370201ffa236b427aa37c9996",
    "chars": 1,
    "preview": "&"
  },
  {
    "path": "src/fuzz/terminal_corpus/9a78211436f6d425ec38f5c4e02270801f3524f8",
    "chars": 1,
    "preview": "@"
  },
  {
    "path": "src/fuzz/terminal_corpus/a70a7fcfa8e88039504b6a798314285419f51e16",
    "chars": 3,
    "preview": "\n\n@"
  },
  {
    "path": "src/fuzz/terminal_corpus/adc83b19e793491b1c6ea0fd8b46cd9f32e592fc",
    "chars": 1,
    "preview": "\n"
  },
  {
    "path": "src/fuzz/terminal_corpus/e0d3c08cb28736844512c52dc05fa4e4efd91490",
    "chars": 2,
    "preview": "\n@"
  },
  {
    "path": "src/fuzz/terminal_corpus/f195c020a28dfc5f2fb6af256b524ddcd93756ed",
    "chars": 0,
    "preview": ""
  },
  {
    "path": "src/fuzz/terminal_fuzzer.cc",
    "chars": 476,
    "preview": "#include <cstddef>\n#include <cstdint>\n\n#include \"src/statesync/completeterminal.h\"\n#include \"src/terminal/parser.h\"\n\next"
  },
  {
    "path": "src/fuzz/terminal_parser_corpus/7164cb6ab7e834fa6145bcf283e94b981313980d",
    "chars": 2,
    "preview": "\n\n"
  },
  {
    "path": "src/fuzz/terminal_parser_corpus/71853c6197a6a7f222db0f1978c7cb232b87c5ee",
    "chars": 2,
    "preview": "\n\n"
  },
  {
    "path": "src/fuzz/terminal_parser_corpus/a09fd95888cb80e1dcea4cc9dbd7d76928909927",
    "chars": 1,
    "preview": "\n"
  },
  {
    "path": "src/fuzz/terminal_parser_corpus/adc83b19e793491b1c6ea0fd8b46cd9f32e592fc",
    "chars": 1,
    "preview": "\n"
  },
  {
    "path": "src/fuzz/terminal_parser_corpus/b67f23988e8274fcf6150a18dacb5ab3db49520d",
    "chars": 1,
    "preview": "\n"
  },
  {
    "path": "src/fuzz/terminal_parser_fuzzer.cc",
    "chars": 301,
    "preview": "#include <cstddef>\n#include <cstdint>\n\n#include \"src/terminal/parser.h\"\n\nextern \"C\" int LLVMFuzzerTestOneInput( const ui"
  },
  {
    "path": "src/include/Makefile.am",
    "chars": 293,
    "preview": "BUILT_SOURCES = version.h\nnodist_INCLUDES = version.h\n\nclean-local:\n\t@rm -rf version.h\n\nversion.h:\t../../VERSION.stamp\n\t"
  },
  {
    "path": "src/network/Makefile.am",
    "chars": 417,
    "preview": "AM_CPPFLAGS = -I$(top_srcdir)/ $(protobuf_CFLAGS)\nAM_CXXFLAGS = $(WARNING_CXXFLAGS) $(PICKY_CXXFLAGS) $(HARDEN_CFLAGS) $"
  },
  {
    "path": "src/network/compressor.cc",
    "chars": 2329,
    "preview": "/*\n    Mosh: the mobile shell\n    Copyright 2012 Keith Winstein\n\n    This program is free software: you can redistribute"
  },
  {
    "path": "src/network/compressor.h",
    "chars": 2022,
    "preview": "/*\n    Mosh: the mobile shell\n    Copyright 2012 Keith Winstein\n\n    This program is free software: you can redistribute"
  },
  {
    "path": "src/network/network.cc",
    "chars": 20258,
    "preview": "/*\n    Mosh: the mobile shell\n    Copyright 2012 Keith Winstein\n\n    This program is free software: you can redistribute"
  },
  {
    "path": "src/network/network.h",
    "chars": 7028,
    "preview": "/*\n    Mosh: the mobile shell\n    Copyright 2012 Keith Winstein\n\n    This program is free software: you can redistribute"
  },
  {
    "path": "src/network/networktransport-impl.h",
    "chars": 7934,
    "preview": "/*\n    Mosh: the mobile shell\n    Copyright 2012 Keith Winstein\n\n    This program is free software: you can redistribute"
  },
  {
    "path": "src/network/networktransport.h",
    "chars": 5123,
    "preview": "/*\n    Mosh: the mobile shell\n    Copyright 2012 Keith Winstein\n\n    This program is free software: you can redistribute"
  },
  {
    "path": "src/network/transportfragment.cc",
    "chars": 6298,
    "preview": "/*\n    Mosh: the mobile shell\n    Copyright 2012 Keith Winstein\n\n    This program is free software: you can redistribute"
  },
  {
    "path": "src/network/transportfragment.h",
    "chars": 3120,
    "preview": "/*\n    Mosh: the mobile shell\n    Copyright 2012 Keith Winstein\n\n    This program is free software: you can redistribute"
  },
  {
    "path": "src/network/transportsender-impl.h",
    "chars": 13028,
    "preview": "/*\n    Mosh: the mobile shell\n    Copyright 2012 Keith Winstein\n\n    This program is free software: you can redistribute"
  },
  {
    "path": "src/network/transportsender.h",
    "chars": 5906,
    "preview": "/*\n    Mosh: the mobile shell\n    Copyright 2012 Keith Winstein\n\n    This program is free software: you can redistribute"
  },
  {
    "path": "src/network/transportstate.h",
    "chars": 1818,
    "preview": "/*\n    Mosh: the mobile shell\n    Copyright 2012 Keith Winstein\n\n    This program is free software: you can redistribute"
  },
  {
    "path": "src/protobufs/Makefile.am",
    "chars": 551,
    "preview": "source = userinput.proto hostinput.proto transportinstruction.proto\n\nAM_CPPFLAGS = $(protobuf_CFLAGS)\nAM_CXXFLAGS = $(WA"
  },
  {
    "path": "src/protobufs/hostinput.proto",
    "chars": 517,
    "preview": "syntax = \"proto2\";\n\noption optimize_for = LITE_RUNTIME;\n\npackage HostBuffers;\n\nmessage HostMessage {\n  repeated Instruct"
  },
  {
    "path": "src/protobufs/transportinstruction.proto",
    "chars": 336,
    "preview": "syntax = \"proto2\";\n\noption optimize_for = LITE_RUNTIME;\n\npackage TransportBuffers;\n\nmessage Instruction {\n  optional uin"
  },
  {
    "path": "src/protobufs/userinput.proto",
    "chars": 424,
    "preview": "syntax = \"proto2\";\n\noption optimize_for = LITE_RUNTIME;\n\npackage ClientBuffers;\n\nmessage UserMessage {\n  repeated Instru"
  },
  {
    "path": "src/statesync/Makefile.am",
    "chars": 285,
    "preview": "AM_CPPFLAGS = -I$(top_srcdir)/ $(protobuf_CFLAGS)\nAM_CXXFLAGS = $(WARNING_CXXFLAGS) $(PICKY_CXXFLAGS) $(HARDEN_CFLAGS) $"
  },
  {
    "path": "src/statesync/completeterminal.cc",
    "chars": 7137,
    "preview": "/*\n    Mosh: the mobile shell\n    Copyright 2012 Keith Winstein\n\n    This program is free software: you can redistribute"
  },
  {
    "path": "src/statesync/completeterminal.h",
    "chars": 3207,
    "preview": "/*\n    Mosh: the mobile shell\n    Copyright 2012 Keith Winstein\n\n    This program is free software: you can redistribute"
  },
  {
    "path": "src/statesync/user.cc",
    "chars": 4772,
    "preview": "/*\n    Mosh: the mobile shell\n    Copyright 2012 Keith Winstein\n\n    This program is free software: you can redistribute"
  },
  {
    "path": "src/statesync/user.h",
    "chars": 3102,
    "preview": "/*\n    Mosh: the mobile shell\n    Copyright 2012 Keith Winstein\n\n    This program is free software: you can redistribute"
  },
  {
    "path": "src/terminal/Makefile.am",
    "chars": 577,
    "preview": "AM_CPPFLAGS = -I$(top_srcdir)/ $(TINFO_CFLAGS)\nAM_CXXFLAGS = $(WARNING_CXXFLAGS) $(PICKY_CXXFLAGS) $(HARDEN_CFLAGS) $(MI"
  },
  {
    "path": "src/terminal/parser.cc",
    "chars": 4864,
    "preview": "/*\n    Mosh: the mobile shell\n    Copyright 2012 Keith Winstein\n\n    This program is free software: you can redistribute"
  },
  {
    "path": "src/terminal/parser.h",
    "chars": 2403,
    "preview": "/*\n    Mosh: the mobile shell\n    Copyright 2012 Keith Winstein\n\n    This program is free software: you can redistribute"
  },
  {
    "path": "src/terminal/parseraction.cc",
    "chars": 2868,
    "preview": "/*\n    Mosh: the mobile shell\n    Copyright 2012 Keith Winstein\n\n    This program is free software: you can redistribute"
  },
  {
    "path": "src/terminal/parseraction.h",
    "chars": 5007,
    "preview": "/*\n    Mosh: the mobile shell\n    Copyright 2012 Keith Winstein\n\n    This program is free software: you can redistribute"
  },
  {
    "path": "src/terminal/parserstate.cc",
    "chars": 10213,
    "preview": "/*\n    Mosh: the mobile shell\n    Copyright 2012 Keith Winstein\n\n    This program is free software: you can redistribute"
  },
  {
    "path": "src/terminal/parserstate.h",
    "chars": 3683,
    "preview": "/*\n    Mosh: the mobile shell\n    Copyright 2012 Keith Winstein\n\n    This program is free software: you can redistribute"
  },
  {
    "path": "src/terminal/parserstatefamily.h",
    "chars": 2853,
    "preview": "/*\n    Mosh: the mobile shell\n    Copyright 2012 Keith Winstein\n\n    This program is free software: you can redistribute"
  },
  {
    "path": "src/terminal/parsertransition.h",
    "chars": 2474,
    "preview": "/*\n    Mosh: the mobile shell\n    Copyright 2012 Keith Winstein\n\n    This program is free software: you can redistribute"
  },
  {
    "path": "src/terminal/terminal.cc",
    "chars": 5830,
    "preview": "/*\n    Mosh: the mobile shell\n    Copyright 2012 Keith Winstein\n\n    This program is free software: you can redistribute"
  },
  {
    "path": "src/terminal/terminal.h",
    "chars": 3219,
    "preview": "/*\n    Mosh: the mobile shell\n    Copyright 2012 Keith Winstein\n\n    This program is free software: you can redistribute"
  },
  {
    "path": "src/terminal/terminaldispatcher.cc",
    "chars": 6981,
    "preview": "/*\n    Mosh: the mobile shell\n    Copyright 2012 Keith Winstein\n\n    This program is free software: you can redistribute"
  },
  {
    "path": "src/terminal/terminaldispatcher.h",
    "chars": 3632,
    "preview": "/*\n    Mosh: the mobile shell\n    Copyright 2012 Keith Winstein\n\n    This program is free software: you can redistribute"
  },
  {
    "path": "src/terminal/terminaldisplay.cc",
    "chars": 17603,
    "preview": "/*\n    Mosh: the mobile shell\n    Copyright 2012 Keith Winstein\n\n    This program is free software: you can redistribute"
  },
  {
    "path": "src/terminal/terminaldisplay.h",
    "chars": 3181,
    "preview": "/*\n    Mosh: the mobile shell\n    Copyright 2012 Keith Winstein\n\n    This program is free software: you can redistribute"
  },
  {
    "path": "src/terminal/terminaldisplayinit.cc",
    "chars": 4342,
    "preview": "/*\n    Mosh: the mobile shell\n    Copyright 2012 Keith Winstein\n\n    This program is free software: you can redistribute"
  },
  {
    "path": "src/terminal/terminalframebuffer.cc",
    "chars": 19076,
    "preview": "/*\n    Mosh: the mobile shell\n    Copyright 2012 Keith Winstein\n\n    This program is free software: you can redistribute"
  },
  {
    "path": "src/terminal/terminalframebuffer.h",
    "chars": 14849,
    "preview": "/*\n    Mosh: the mobile shell\n    Copyright 2012 Keith Winstein\n\n    This program is free software: you can redistribute"
  },
  {
    "path": "src/terminal/terminalfunctions.cc",
    "chars": 19686,
    "preview": "/*\n    Mosh: the mobile shell\n    Copyright 2012 Keith Winstein\n\n    This program is free software: you can redistribute"
  },
  {
    "path": "src/terminal/terminaluserinput.cc",
    "chars": 2885,
    "preview": "/*\n    Mosh: the mobile shell\n    Copyright 2012 Keith Winstein\n\n    This program is free software: you can redistribute"
  },
  {
    "path": "src/terminal/terminaluserinput.h",
    "chars": 1951,
    "preview": "/*\n    Mosh: the mobile shell\n    Copyright 2012 Keith Winstein\n\n    This program is free software: you can redistribute"
  },
  {
    "path": "src/tests/.gitignore",
    "chars": 105,
    "preview": "/base64\n/base64_vector.cc\n/ocb-aes\n/encrypt-decrypt\n/nonce-incr\n/inpty\n/is-utf8-locale\n/*.d/\n*.log\n*.trs\n"
  },
  {
    "path": "src/tests/Makefile.am",
    "chars": 2837,
    "preview": "EXTRA_DIST = \\\n\thold-stdin print-exitstatus \\\n\te2e-test e2e-test-server \\\n\te2e-test-subrs \\\n\tmosh-client mosh-server \\\n\t"
  },
  {
    "path": "src/tests/README.md",
    "chars": 6954,
    "preview": "# Mosh Tests\n\n## ocb-aes\n\nThis is a unit test for the OCB-AES encryption used in mosh, including\nRogaway's OCB implement"
  },
  {
    "path": "src/tests/base64.cc",
    "chars": 4700,
    "preview": "/*\n    Mosh: the mobile shell\n    Copyright 2012 Keith Winstein\n\n    This program is free software: you can redistribute"
  },
  {
    "path": "src/tests/base64_vector.h",
    "chars": 180,
    "preview": "struct base64_test_row\n{\n  const unsigned char native[17];\n  const char encoded[25];\n};\ntypedef base64_test_row* base64_"
  },
  {
    "path": "src/tests/e2e-failure.test",
    "chars": 459,
    "preview": "#!/bin/sh\n\n# shellcheck source=e2e-test-subrs\n. \"$(dirname \"$0\")/e2e-test-subrs\"\nPATH=$PATH:.:$srcdir\n# Top-level wrappe"
  },
  {
    "path": "src/tests/e2e-success.test",
    "chars": 475,
    "preview": "#!/bin/sh\n\n# shellcheck source=e2e-test-subrs\n. \"$(dirname \"$0\")/e2e-test-subrs\"\nPATH=$PATH:.:$srcdir\n# Top-level wrappe"
  },
  {
    "path": "src/tests/e2e-test",
    "chars": 7272,
    "preview": "#!/bin/sh\n\n. \"$(dirname \"$0\")/e2e-test-subrs\"\n\n#\n# Validate that mosh produces expected output, using screen captures\n# "
  },
  {
    "path": "src/tests/e2e-test-server",
    "chars": 2112,
    "preview": "#!/bin/sh\n\n#\n# Harness script for Mosh tests, server side.  Runs test script and\n# then captures screen with `tmux captu"
  },
  {
    "path": "src/tests/e2e-test-subrs",
    "chars": 2568,
    "preview": "#!/bin/sh\n\n#\n# This is a library of subroutines mostly intended for test scripts.\n#\n\nfail()\n{\n    printf \"$@\" 2>&1\n    e"
  },
  {
    "path": "src/tests/emulation-80th-column.test",
    "chars": 1241,
    "preview": "#!/bin/sh\n\n#\n# This test validates the ancient VT100 behavior of positioning the\n# cursor at column 80 (and not wrapping"
  },
  {
    "path": "src/tests/emulation-ascii-iso-8859.test",
    "chars": 1509,
    "preview": "#!/bin/sh\n\n#\n# This validates display of ASCII and ISO-8859-1 characters.\n#\n\n# shellcheck source=e2e-test-subrs\n. \"$(dir"
  },
  {
    "path": "src/tests/emulation-attributes.test",
    "chars": 4025,
    "preview": "#!/bin/sh\n\n#\n# This validates VT100, 16-color, 256-color and true color attributes\n# against tmux.  It is not run direct"
  },
  {
    "path": "src/tests/emulation-back-tab.test",
    "chars": 1228,
    "preview": "#!/bin/sh\n\n#\n# This test is for issue 539 on github.\n#\n\n# shellcheck source=e2e-test-subrs\n. \"$(dirname \"$0\")/e2e-test-s"
  },
  {
    "path": "src/tests/emulation-cursor-motion.test",
    "chars": 799,
    "preview": "#!/bin/sh\n\n#\n# This test exercises a particular optimization involving small cursor\n# motions in Mosh.\n#\n\n# shellcheck s"
  },
  {
    "path": "src/tests/emulation-multiline-scroll.test",
    "chars": 1099,
    "preview": "#!/bin/sh\n\n#\n# This is a regression test for a crash seen in my development\n# of performance code for Mosh, involving in"
  },
  {
    "path": "src/tests/emulation-scroll.test",
    "chars": 1600,
    "preview": "#!/bin/sh\n\n#\n# This is a regression test for a bug in Mosh: it would move the\n# cursor for the SCROLL UP and SCROLL DOWN"
  },
  {
    "path": "src/tests/emulation-wrap-across-frames.test",
    "chars": 1056,
    "preview": "#!/bin/sh\n\n#\n# This is a regression test for a bug seen where mosh-server's\n# round-trip verification failed if text was"
  },
  {
    "path": "src/tests/encrypt-decrypt.cc",
    "chars": 4329,
    "preview": "/*\n    Mosh: the mobile shell\n    Copyright 2012 Keith Winstein\n\n    This program is free software: you can redistribute"
  },
  {
    "path": "src/tests/genbase64.pl",
    "chars": 959,
    "preview": "#!/usr/bin/perl\n\nuse strict;\nuse warnings;\nuse MIME::Base64;\n\nmy @vectors = (\n    \"\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\"
  },
  {
    "path": "src/tests/hold-stdin",
    "chars": 457,
    "preview": "#!/usr/bin/env perl\n\n#\n# The sole function of this script is to provide a stdin that doesn't\n# read data or return EOF t"
  },
  {
    "path": "src/tests/inpty.cc",
    "chars": 3648,
    "preview": "/*\n    Mosh: the mobile shell\n    Copyright 2012 Keith Winstein\n\n    This program is free software: you can redistribute"
  },
  {
    "path": "src/tests/is-utf8-locale.cc",
    "chars": 1748,
    "preview": "/*\n    Mosh: the mobile shell\n    Copyright 2012 Keith Winstein\n\n    This program is free software: you can redistribute"
  },
  {
    "path": "src/tests/local.test",
    "chars": 436,
    "preview": "#!/bin/sh\n\n. \"$(dirname \"$0\")/e2e-test-subrs\"\nif ! set_locale; then\n    echo \"$0: no usable locale\" >&2\n    exit 99\nfi\n\n"
  },
  {
    "path": "src/tests/network-no-diff.test",
    "chars": 1189,
    "preview": "#!/bin/sh\n\n#\n# This is a regression test to ensure that Mosh does not spin\n# on updates that do not actually change the "
  },
  {
    "path": "src/tests/nonce-incr.cc",
    "chars": 2498,
    "preview": "/*\n    Mosh: the mobile shell\n    Copyright 2012 Keith Winstein\n\n    This program is free software: you can redistribute"
  },
  {
    "path": "src/tests/ocb-aes.cc",
    "chars": 28226,
    "preview": "/*\n    Mosh: the mobile shell\n    Copyright 2012 Keith Winstein\n\n    This program is free software: you can redistribute"
  },
  {
    "path": "src/tests/prediction-unicode.test",
    "chars": 2470,
    "preview": "#!/bin/sh\n\n#\n# This is a regression test for a bug seen where mosh-client's\n# prediction code would sometimes show \"gück"
  },
  {
    "path": "src/tests/print-exitstatus",
    "chars": 603,
    "preview": "#!/usr/bin/env perl\n\n#\n# Print exitstatus on stderr.\n#\nuse warnings;\nuse strict;\n\nmy $rc = system(@ARGV);\nif ($? == -1) "
  },
  {
    "path": "src/tests/pty-deadlock.test",
    "chars": 2171,
    "preview": "#!/bin/sh\n\n#\n# This is a regression test for a BSD pty bug in Mosh.  On\n# FreeBSD/OpenBSD/OS X, a pty master can block o"
  },
  {
    "path": "src/tests/repeat.test",
    "chars": 1524,
    "preview": "#!/bin/sh\n\n#\n# Run mosh many times.  If run as repeat-with-stdin.test, also send\n# input constantly, to try and trigger "
  },
  {
    "path": "src/tests/server-network-timeout.test",
    "chars": 2914,
    "preview": "#!/bin/sh\n\n#\n# This test checks for operation of the MOSH_SERVER_NETWORK_TMOUT variable.\n# It does this by\n# * setting t"
  },
  {
    "path": "src/tests/test_utils.cc",
    "chars": 2202,
    "preview": "/*\n    Mosh: the mobile shell\n    Copyright 2012 Keith Winstein\n\n    This program is free software: you can redistribute"
  },
  {
    "path": "src/tests/test_utils.h",
    "chars": 1797,
    "preview": "/*\n    Mosh: the mobile shell\n    Copyright 2012 Keith Winstein\n\n    This program is free software: you can redistribute"
  },
  {
    "path": "src/tests/unicode-combine-fallback-assert.test",
    "chars": 689,
    "preview": "#!/bin/sh\n\n#\n# This test is for Github issue 667\n# https://github.com/mobile-shell/mosh/issues/667\n# where mosh will ass"
  },
  {
    "path": "src/tests/unicode-later-combining.test",
    "chars": 1350,
    "preview": "#!/bin/sh\n\n#\n# This test is for the first Unicode issue described on the Mosh web\n# page, a combining character drawn on"
  },
  {
    "path": "src/tests/window-resize.test",
    "chars": 1713,
    "preview": "#!/bin/sh\n\n#\n# This is a regression test for window resizing in Mosh.  Making it\n# happen is a little kludgy: we have to"
  },
  {
    "path": "src/util/Makefile.am",
    "chars": 337,
    "preview": "AM_CXXFLAGS = -I$(top_srcdir)/ $(WARNING_CXXFLAGS) $(PICKY_CXXFLAGS) $(HARDEN_CFLAGS) $(MISC_CXXFLAGS) $(CODE_COVERAGE_C"
  },
  {
    "path": "src/util/dos_assert.h",
    "chars": 2105,
    "preview": "/*\n    Mosh: the mobile shell\n    Copyright 2012 Keith Winstein\n\n    This program is free software: you can redistribute"
  },
  {
    "path": "src/util/fatal_assert.h",
    "chars": 1968,
    "preview": "/*\n    Mosh: the mobile shell\n    Copyright 2012 Keith Winstein\n\n    This program is free software: you can redistribute"
  },
  {
    "path": "src/util/locale_utils.cc",
    "chars": 3729,
    "preview": "/*\n    Mosh: the mobile shell\n    Copyright 2012 Keith Winstein\n\n    This program is free software: you can redistribute"
  },
  {
    "path": "src/util/locale_utils.h",
    "chars": 1912,
    "preview": "/*\n    Mosh: the mobile shell\n    Copyright 2012 Keith Winstein\n\n    This program is free software: you can redistribute"
  },
  {
    "path": "src/util/pty_compat.cc",
    "chars": 4723,
    "preview": "/*\n    Mosh: the mobile shell\n    Copyright 2012 Keith Winstein\n\n    This program is free software: you can redistribute"
  },
  {
    "path": "src/util/pty_compat.h",
    "chars": 1827,
    "preview": "/*\n    Mosh: the mobile shell\n    Copyright 2012 Keith Winstein\n\n    This program is free software: you can redistribute"
  },
  {
    "path": "src/util/select.cc",
    "chars": 1783,
    "preview": "/*\n    Mosh: the mobile shell\n    Copyright 2012 Keith Winstein\n\n    This program is free software: you can redistribute"
  },
  {
    "path": "src/util/select.h",
    "chars": 7022,
    "preview": "/*\n    Mosh: the mobile shell\n    Copyright 2012 Keith Winstein\n\n    This program is free software: you can redistribute"
  },
  {
    "path": "src/util/swrite.cc",
    "chars": 2017,
    "preview": "/*\n    Mosh: the mobile shell\n    Copyright 2012 Keith Winstein\n\n    This program is free software: you can redistribute"
  },
  {
    "path": "src/util/swrite.h",
    "chars": 1574,
    "preview": "/*\n    Mosh: the mobile shell\n    Copyright 2012 Keith Winstein\n\n    This program is free software: you can redistribute"
  },
  {
    "path": "src/util/timestamp.cc",
    "chars": 4115,
    "preview": "/*\n    Mosh: the mobile shell\n    Copyright 2012 Keith Winstein\n\n    This program is free software: you can redistribute"
  }
]

// ... and 15 more files (download for full content)

About this extraction

This page contains the full source code of the mobile-shell/mosh GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 215 files (886.5 KB), approximately 252.3k tokens, and a symbol index with 308 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.

Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.

Copied to clipboard!