Skip to content

Remove Boost dependency - #158

Closed
kmcallister wants to merge 15 commits into
mobile-shell:masterfrom
kmcallister:rm-boost
Closed

kmcallister wants to merge 15 commits into
mobile-shell:masterfrom
kmcallister:rm-boost

Conversation

@kmcallister

Copy link
Copy Markdown
Contributor

There are various objections to our use of Boost.

  • When you install the Boost header package, some distributions will grab 100 MB of Boost binary packages, none of which we use.
  • Worse still, Gentoo will spend hours compiling them.
  • The version of Boost that ships with RHEL/CentOS 5 is too old for Mosh. You can get a newer one from EPEL, but a great many potential Mosh users can't install new packages, and just want to build Mosh in their homedir.
  • We'd have to do something for Android as well.

I managed to replace all our uses of Boost with vanilla C++98 constructs.

  • BOOST_AUTO is easy enough. We just spell out the type names, and add a few typedefs to make it more compact.
  • boost::lambda is trickier. We replace some of it (particularly for_each and find_if) with ordinary loops. Other bits use the awful C++98 faux-functional stuff: std::mem_fun_ref, std::bind2nd, etc. This seems worthwhile for remove_if, where the equivalent loop is bigger, trickier, and depends on the container type.

Builds on GNU/Linux with g++ 4.1.2 (EL5), g++ 4.6.3, or clang++ 3.0.

@peterjeremy

Copy link
Copy Markdown
Contributor

+1 This would be a great improvement.

@keithw keithw closed this in cd2d482 Apr 15, 2012
This was referenced Apr 17, 2012
friedenberg added a commit to amarbel-llc/posh that referenced this pull request Aug 10, 2026
The interactive default listing now answers "what is posh doing on
this machine" whole: the session table, then any live per-destination
mux endpoints (the mux ls lines, suppressed when none — keyed off the
exported MUX_LS_EMPTY sentinel, not a string copy). The machine
formats stay session-only by contract: --short is the completion
source, --json the stable shape, and the piped default is unchanged
for scripts.

posh list --watch [--interval N] re-renders that unified view in the
alternate screen (the FDR 0002 terminfo-aware smcup/rmcup pair): q or
Ctrl-C quits, r refreshes immediately, resizes are picked up on the
next render. Input runs under a new pty::CbreakMode — RawMode's
lighter sibling: per-key input with ICANON/ECHO/ISIG cleared but
OPOST intact, so the one-shot renderers' plain newlines still return
the carriage, and Ctrl-C arrives as a byte so the alt-screen teardown
stays in our hands instead of a default SIGINT kill stranding it.
--watch with a machine format is rejected; a zero interval clamps to
1 s (a busy-loop otherwise).

The flag shape is pure and pinned (parse_list_args_shapes); CbreakMode
is pinned against a real pty (flags cleared, OPOST kept, drop
restores). Completions and posh(1) updated.

Closes mobile-shell#158. Closes #125.

:clown: Clown 0.4.3+f631613 — https://code.linenisgreat.com/clown/commit/f631613b2ebc05409d0da67c708b92910a67ea55
friedenberg added a commit to amarbel-llc/posh that referenced this pull request Aug 19, 2026
endpoint_status_ls — the server-host counterpart of mux ls — scans
agent/*.status.sock and reads each connect→EOF (200 ms bound, the
RFC 0013 §4 tuning lever), labeling refused/empty answers stale. The
unified interactive posh list (and --watch) appends the section under
the mux one; the machine formats stay session-only by the mobile-shell#158
contract. A missing agent dir is "no endpoints", never an error.

Task 8 of docs/plans/2026-08-19-server-introspection.md.

:clown: Clown 0.4.4+e781f74 — https://code.linenisgreat.com/clown/commit/e781f74404c11650690d7ea73c7c72bc52221b33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants