This commit is contained in:
Aram Drevekenin 2020-10-31 20:37:42 +01:00
commit fbeb7f09dc
9 changed files with 234 additions and 2 deletions

22
.github/workflows/rust.yml vendored Normal file
View file

@ -0,0 +1,22 @@
name: Rust
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
env:
CARGO_TERM_COLOR: always
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Build
run: cargo build --verbose
- name: Run tests
run: cargo test --verbose

76
CODE_OF_CONDUCT.md Normal file
View file

@ -0,0 +1,76 @@
# Contributor Covenant Code of Conduct
## Our Pledge
In the interest of fostering an open and welcoming environment, we as
contributors and maintainers pledge to making participation in our project and
our community a harassment-free experience for everyone, regardless of age, body
size, disability, ethnicity, sex characteristics, gender identity and expression,
level of experience, education, socio-economic status, nationality, personal
appearance, race, religion, or sexual identity and orientation.
## Our Standards
Examples of behavior that contributes to creating a positive environment
include:
* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members
Examples of unacceptable behavior by participants include:
* The use of sexualized language or imagery and unwelcome sexual attention or
advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic
address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting
## Our Responsibilities
Project maintainers are responsible for clarifying the standards of acceptable
behavior and are expected to take appropriate and fair corrective action in
response to any instances of unacceptable behavior.
Project maintainers have the right and responsibility to remove, edit, or
reject comments, commits, code, wiki edits, issues, and other contributions
that are not aligned to this Code of Conduct, or to ban temporarily or
permanently any contributor for other behaviors that they deem inappropriate,
threatening, offensive, or harmful.
## Scope
This Code of Conduct applies both within project spaces and in public spaces
when an individual is representing the project or its community. Examples of
representing a project or community include using an official project e-mail
address, posting via an official social media account, or acting as an appointed
representative at an online or offline event. Representation of a project may be
further defined and clarified by project maintainers.
## Enforcement
Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project team at aram@poor.dev. All
complaints will be reviewed and investigated and will result in a response that
is deemed necessary and appropriate to the circumstances. The project team is
obligated to maintain confidentiality with regard to the reporter of an incident.
Further details of specific enforcement policies may be posted separately.
Project maintainers who do not follow or enforce the Code of Conduct in good
faith may face temporary or permanent repercussions as determined by other
members of the project's leadership.
## Attribution
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
[homepage]: https://www.contributor-covenant.org
For answers to common questions about this code of conduct, see
https://www.contributor-covenant.org/faq

25
GOVERNANCE.md Normal file
View file

@ -0,0 +1,25 @@
# Mosaic Governance
Mosaic is an open source project that belongs to those who contribute to it.
As such, we feel it's important to codify some rules that seem obvious and straightforward now, but might not be in the future.
## Organization members
Members of the Mosaic organization are in effect those empowered to make decisions for the project. Individual members are trusted to make decisions on their own and to bring larger and more controversial decisions to be decided by the full quorum of members in a real-time meeting or by correspondence.
## How decisions are made regarding the project
When larger decisions are brought to the full quorum of members, we would like to hear all the voices and dissenting opinions on the decision at hand. Ideally, we would then decide on a course of action by consensus. Only if one cannot be reached, will each member of the organization get a vote. The decision in the majority will be taken.
In case of ties, one member designated as Arbiter can break the tie. For reasons of focus and expediency, the Arbiter also has veto privileges which are to be used as scarecely as possible.
Some decisions that should always be brought to the quorum of members:
* Adding new members to the organization
* Any decision involving money or finances
* Collaborations with outside organizations
## Role of the Arbiter
The Arbiter is a member of the quorum who serves as a tie breaker in votes and also has veto privileges for the votes themselves. Both of these should be used as seldom as possible and preferably not at all.
Once the organization reaches 10 members, a reasonable and achievable process must be established in order to replace the Arbiter if the need arises (for example: a majority vote of members can replace the Arbiter with another candidate). In any case, the Arbiter has to be an organization member.
## Current Organization Members
* Aram Drevekenin <aram@poor.dev> (Arbiter)
* Doron Tsur <qballer@gmail.com>
* Brooks Rady <b.j.rady@gmail.com>

21
LICENSE.md Normal file
View file

@ -0,0 +1,21 @@
MIT License
Copyright (c) 2020 Mosaic contributors
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

79
README.md Normal file
View file

@ -0,0 +1,79 @@
<h1 align="center">
<br>
<img src="mosaic-logo-hexagon.png" alt="logo" width="200">
<br>
Mosaic
<br>
<br>
</h1>
<p align="center">
<img src="demo.gif" alt="demo">
</p>
<p align="center">
<a href="https://discord.gg/CrUAFH3"><img alt="Discord Chat" src="https://img.shields.io/discord/771367133715628073"></a>
</p>
# What is this?
Mosaic is a workspace aimed at developers, ops-oriented people and anyone who loves the terminal.
At its core, it is a terminal multiplexer (similar to [tmux](https://github.com/tmux/tmux) and [screen](https://www.gnu.org/software/screen/)), but this is merely its infrastructure layer.
For more details, read about upcoming features in our [roadmap](roadmap.md).
Right now Mosaic is in its early development stages and is not yet ready for everyday usage.
If you're interested, watch this space or better yet - get involved!
## How to use it?
* Clone the project
* In the project folder, run: `cargo run`
(note that right now Mosaic only supports linux and maybe mac)
Some temporary controls (these will be changed to something more convenient when the project matures a little):
* ctrl-n - split focused pane vertically
* ctrl-b - split focused pane horizontally
* ctrl-j - resize focused pane down
* ctrl-k - resize focused pane up
* ctrl-h - resize focused pane left
* ctrl-l - resize focused pane right
* ctrl-p - move focus to next pane
* ctrl-[ - scroll up in focused pane
* ctrl-] - scroll down in focused pane
* ctrl-x - close focused pane
* ctrl-q - quit Mosaic
# What is the current status of the project?
Mosaic is in the last stages of being VT compatible. As much as modern terminals are.
Most things should work inside a terminal pane, but some edge cases don't.
Right now, Mosaic:
* Successfully renders shells (all experiments have been done with fish-cli).
* Can split the terminal into multiple horizontal/vertical panes
* Can resize panes, as well as close them
* Can scroll up and down inside a pane
* Can render a vim pane
* Can render most so called "raw mode" applications that draw a textual user interface and refresh themselves.
Please, don't do anything important with it. It's currently being stabilized and still panics quite a bit. :)
# How do I get involved?
At the moment, the project is in early development and prototyping.
A lot of the work needed to be done is product work (making decisions about what Mosaic will be and do) as well as development work. So note that most tasks would probably involve a little of both.
We're a small team of enthusiasts, and we eagerly welcome people who would like to join in at this early stage.
Because of the above, it's not trivial for us to have issues tagged "Help Wanted" or "Good First Issue", as all work would likely need some prior discussion.
That said, we would absolutely love to have these discussions and to bring more people on. Even if you are unsure of your abilities or have never contributed to open source before.
To get started, join our chat and let us know you're interested in contributing: https://discord.gg/CrUAFH3
We respectfully ask that you do your best to stand by any commitments you make.
And most importantly, please read our [code of conduct](CODE_OF_CONDUCT.md).
# License
MIT

BIN
demo.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 MiB

BIN
mosaic-logo-hexagon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 224 KiB

8
roadmap.md Normal file
View file

@ -0,0 +1,8 @@
# Roadmap
This file contains an ever-changing list of the major features that are either currently being worked on, or planned for the near future.
* <b>A layout engine</b> that would allow you to define how your panes will be (re)arranged when you open or close them. As well as when you change the terminal window size.
* <b>Pane types beyond a simple shell prompt</b> such as a file explorer that can open files for editing in new panes, a launcher that would open commands in a new pane, a command pane that would run just one command when clicked, changing its frame colour with each exit status it receives appropriately, and many more.
* <b>A Webassembly plugin system for compiled languages</b> built using WASI to allow you to write plugins in any compiled language. These plugins would be able to create new panes, interact with existing ones, interact with the filesystem and subscribe to events. You could consume them at runtime and decide what permissions to give them.
* <b>Built in support for portable workspaces across machines, projects and teams</b>: imagine being able to include a configuration file with your project that would include all the layouts and plugins that would best help new developers getting onboarded. Including all the shortcuts, customized panes and help-message hints triggered by things such as opening a file, entering a folder or running a command. How about being able to log into a new server or container, start mosaic with a URL of a git repository including your favorite configuration and plugins, and working with it as if you were on your own machine?
* <b>Support for multiple terminal windows across screens</b>: Why limit yourself to one terminal window? Mosaic would allow you to transfer panes, view powerlines, get alerts and control your workspace from different windows by having them all belong to the same session.

View file

@ -1532,9 +1532,10 @@ impl vte::Perform for TerminalOutput {
// insert blank lines if inside scroll region // insert blank lines if inside scroll region
let line_count_to_add = if params[0] == 0 { 1 } else { params[0] as usize }; let line_count_to_add = if params[0] == 0 { 1 } else { params[0] as usize };
self.scroll.add_empty_lines_in_scroll_region(line_count_to_add); self.scroll.add_empty_lines_in_scroll_region(line_count_to_add);
} else if c == 'q' || c == 'd' || c == 'X' || c == 'G' {
// ignore for now to run on mac
} else { } else {
println!("unhandled csi: {:?}->{:?}", c, params); panic!("unhandled csi: {:?}->{:?}", c, params);
panic!("aaa!!!");
} }
} }