GithubHelp home page GithubHelp logo

zulip / zulip-terminal Goto Github PK

View Code? Open in Web Editor NEW
590.0 17.0 240.0 7.12 MB

Official Zulip terminal client.

License: Apache License 2.0

Python 99.77% Shell 0.13% Makefile 0.10%
python terminal chat zulip urwid python3 collaboration zulip-client

zulip-terminal's Introduction

Zulip Terminal - Zulip's official terminal client

Recent changes | Configuration | Hot Keys | FAQs | Development | Tutorial

Chat with us! PyPI Python Versions Python Implementations OS Platforms

GitHub Actions - Linting & tests Coverage status Checked with mypy code style: black Ruff

Screenshot

About

Zulip Terminal is the official terminal client for Zulip, providing a text-based user interface (TUI).

Specific aims include:

  • Providing a broadly similar user experience to the Zulip web client, ultimately supporting all of its features
  • Enabling all actions to be achieved through the keyboard (see Hot keys)
  • Exploring alternative user interface designs suited to the display and input constraints
  • Supporting a wide range of platforms and terminal emulators
  • Making best use of available rows/columns to scale from 80x24 upwards (see Small terminal notes)

Learn how to use Zulip Terminal with our Tutorial.

Feature status

We consider the client to already provide a fairly stable moderately-featureful everyday-user experience.

The current development focus is on improving aspects of everyday usage which are more commonly used - to reduce the need for users to temporarily switch to another client for a particular feature.

Current limitations which we expect to only resolve over the long term include support for:

  • All operations performed by users with extra privileges (owners/admins)
  • Accessing and updating all settings
  • Using a mouse/pointer to achieve all actions
  • An internationalized UI

Intentional differences

The terminal client currently has a number of intentional differences to the Zulip web client:

  • Additional and occasionally different Hot keys to better support keyboard-only navigation; other than directional movement these also include:
    • z - zoom in/out, between streams & topics, or all direct messages & specific conversations
    • t - toggle view of topics for a stream in left panel (later adopted for recent topics in web client)
    • # - narrow to messages in which you're mentioned (@ is already used)
    • f - narrow to messages you've starred (are following)
  • Not marking additional messages read when the end of a conversation is visible (FAQ entry)
  • Emoji and reactions are rendered as text only, for maximum terminal/font compatibility
  • Footlinks - footnotes for links (URLs) - make messages readable, while retaining a list of links to cross-reference
  • Content previewable in the web client, such as images, are also stored as footlinks

Feature queries?

For queries on missing feature support please take a look at the Frequently Asked Questions (FAQs), our open Issues, or chat with users & developers online at the Zulip Community server!

Installation

We recommend installing in a dedicated python virtual environment (see below) or using an automated option such as pipx

  • Stable releases - These are available on PyPI as the package zulip-term

    To install, run a command like: pip3 install zulip-term

  • Latest (git) versions - The latest development version can be installed from the git repository main branch

    To install, run a command like: pip3 install git+https://github.com/zulip/zulip-terminal.git@main

We also provide some sample Dockerfiles to build docker images in docker/.

Installing into an isolated Python virtual environment

With the python 3.6+ required for running, the following should work on most systems:

  1. python3 -m venv zt_venv (creates a virtual environment named zt_venv in the current directory)
  2. source zt_venv/bin/activate (activates the virtual environment; this assumes a bash-like shell)
  3. Run one of the install commands above.

If you open a different terminal window (or log-off/restart your computer), you'll need to run step 2 of the above list again before running zulip-term, since that activates that virtual environment. You can read more about virtual environments in the Python 3 library venv documentation.

Keeping your install up to date

Note that there is no automatic-update system, so please track the update locations relevant to your installation version:

Stable releases

Before upgrading, we recommend you check the Changes in recent releases so you are aware of any important changes between releases.

  • These are now announced in the #announce>terminal releases topic on the Zulip Community server (https://chat.zulip.org), which is visible without an account.

    If you wish to receive emails when updates are announced, you are welcome to sign up for an account on this server, which will enable you to enable email notifications for the #announce stream (help article, notifications settings on chat.zulip.org).

  • You can also customize your GitHub Watch setting on the project page to include releases.

  • PyPI provides a RSS Release feed, and various other services track this information.

Latest (git) versions

Versions installed from the main git branch will also not update automatically - the 'latest' refers to the status at the point of installation.

This also applies to other source or development installs (eg. https://aur.archlinux.org/packages/python-zulip-term-git/).

Therefore, upgrade your package using the command above, or one pertinent to your package system (eg. Arch).

While the main branch is intended to remain stable, if upgrading between two arbitrary 'latest' versions, please be aware that changes are not summarized, though our commit log should be very readable.

Running for the first time

Upon first running zulip-term it looks for a zuliprc file, by default in your home directory, which contains the details to log into a Zulip server.

If it doesn't find this file, you have two options:

  1. zulip-term will prompt you for your server, email and password, and create a zuliprc file for you in that location

    NOTE: If you use Google, Github or another external authentication to access your Zulip organization then you likely won't have a password set and currently need to create one to use zulip-terminal.

  2. Each time you run zulip-term, you can specify the path to an alternative zuliprc file using the -c or --config-file options, eg. $ zulip-term -c /path/to/zuliprc

    A .zuliprc file corresponding to your account on a particular Zulip server can be downloaded via Web or Desktop applications connected to that server. In recent versions this can be found in your Personal settings in the Account & privacy section, under API key as 'Show/change your API key'.

    If this is your only Zulip account, you may want to move and rename this file to the default file location above, or rename it to something more memorable that you can pass to the ---config-file option. This .zuliprc file gives you all the permissions you have as that user.

    Similar .zuliprc files can be downloaded from the Bots section for any bots you have set up, though with correspondingly limited permissions.

NOTE: If your server uses self-signed certificates or an insecure connection, you will need to add extra options to the zuliprc file manually - see the documentation for the Zulip python module.

We suggest running zulip-term using the -e or --explore option (in explore mode) when you are trying Zulip Terminal for the first time, where we intentionally do not mark messages as read. Try following along with our Tutorial to get the hang of things.

Configuration

The zuliprc file contains two sections:

  • an [api] section with information required to connect to your Zulip server
  • a [zterm] section with configuration specific to zulip-term

A file with only the first section can be auto-generated in some cases by zulip-term, or you can download one from your account on your server (see above). Parts of the second section can be added and adjusted in stages when you wish to customize the behavior of zulip-term.

The example below, with dummy [api] section contents, represents a working configuration file with all the default compatible [zterm] values uncommented and with accompanying notes:

[api]
[email protected]
key=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
site=https://example.zulipchat.com

[zterm]
## Theme: available themes can be found by running `zulip-term --list-themes`, or in docs/FAQ.md
theme=zt_dark

## Autohide: set to 'autohide' to hide the left & right panels except when they're focused
autohide=no_autohide

## Exit Confirmation: set to 'disabled' to exit directly with no warning popup first
exit_confirmation=enabled

## Footlinks: set to 'disabled' to hide footlinks; 'enabled' will show the first 3 per message
## For more flexibility, comment-out this value, and un-comment maximum-footlinks below
footlinks=enabled
## Maximum-footlinks: set to any value 0 or greater, to limit footlinks shown per message
# maximum-footlinks=3

## Notify: set to 'enabled' to display notifications (see elsewhere for configuration notes)
notify=disabled

## Color-depth: set to one of 1 (for monochrome), 16, 256, or 24bit
color-depth=256

NOTE: Most of these configuration settings may be specified on the command line when zulip-term is started; zulip-term -h or zulip-term --help will give the full list of options.

Notifications

Note that notifications are not currently supported on WSL; see #767.

Linux

The following command installs notify-send on Debian based systems, similar commands can be found for other linux systems as well.

sudo apt-get install libnotify-bin

OSX

No additional package is required to enable notifications in OS X. However to have a notification sound, set the following variable (based on your type of shell). The sound value (here Ping) can be any one of the .aiff files found at /System/Library/Sounds or ~/Library/Sounds.

Bash

echo 'export ZT_NOTIFICATION_SOUND=Ping' >> ~/.bash_profile
source ~/.bash_profile

ZSH

echo 'export ZT_NOTIFICATION_SOUND=Ping' >> ~/.zshenv
source ~/.zshenv

Copy to clipboard

Zulip Terminal allows users to copy certain texts to the clipboard via a Python module, Pyperclip. This module makes use of various system packages which may or may not come with the OS. The "Copy to clipboard" feature is currently only available for copying Stream email, from the Stream information popup.

Linux

On Linux, this module makes use of xclip or xsel commands, which should already come with the OS. If none of these commands are installed on your system, then install any ONE using:

sudo apt-get install xclip [Recommended]

OR

sudo apt-get install xsel

OSX and WSL

No additional package is required to enable copying to clipboard.

Chat with fellow users & developers!

While Zulip Terminal is designed to work with any Zulip server, the main contributors are present on the Zulip Community server at https://chat.zulip.org, with most conversation in the #zulip-terminal stream.

You are welcome to view conversations in that stream using the link above, or sign up for an account and chat with us - whether you are a user or developer!

We aim to keep the Zulip community friendly, welcoming and productive, so if participating, please respect our Community norms.

Notes more relevant to the #zulip-terminal stream

These are a subset of the Community norms linked above, which are more relevant to users of Zulip Terminal: those more likely to be in a text environment, limited in character rows/columns, and present in this one smaller stream.

  • Prefer text in code blocks, instead of screenshots

    Zulip Terminal supports downloading images, but there is no guarantee that users will be able to view them.

    Try Meta+m to see example content formatting, including code blocks

  • Prefer silent mentions over regular mentions - or avoid mentions entirely

    With Zulip's topics, the intended recipient can often already be clear. Experienced members will be present as their time permits - responding to messages when they return - and others may be able to assist before then.

    (Save regular mentions for those who you do not expect to be present on a regular basis)

    Try Ctrl+f/b to cycle through autocompletion in message content, after typing @_ to specify a silent mention

  • Prefer trimming quote and reply text to only the relevant parts of longer messages - or avoid quoting entirely

    Zulip's topics often make it clear which message you're replying to. Long messages can be more difficult to read with limited rows and columns of text, but this is worsened if quoting an entire long message with extra content.

    Try > to quote a selected message, deleting text as normal when composing a message

  • Prefer a quick emoji reaction to show agreement instead of simple short messages

    Reactions take up less space, including in Zulip Terminal, particularly when multiple users wish to respond with the same sentiment.

    Try + to toggle thumbs-up (+1) on a message, or use : to search for other reactions

Contributor Guidelines

Zulip Terminal is being built by the awesome Zulip community.

To be a part of it and to contribute to the code, feel free to work on any issue or propose your idea on #zulip-terminal.

For commit structure and style, please review the Commit Style section below.

If you are new to git (or not!), you may benefit from the Zulip git guide. When contributing, it's important to note that we use a rebase-oriented workflow.

A simple tutorial is available for implementing the typing indicator. Follow it to understand how to implement a new feature for zulip-terminal.

You can of course browse the source on GitHub & in the source tree you download, and check the source file overview for ideas of how files are currently arranged.

Urwid

Zulip Terminal uses urwid to render the UI components in terminal. Urwid is an awesome library through which you can render a decent terminal UI just using python. Urwid's Tutorial is a great place to start for new contributors.

Getting Zulip Terminal code and connecting it to upstream

First, fork the zulip/zulip-terminal repository on GitHub (see how) and then clone your forked repository locally, replacing YOUR_USERNAME with your GitHub username:

$ git clone --config pull.rebase [email protected]:YOUR_USERNAME/zulip-terminal.git

This should create a new directory for the repository in the current directory, so enter the repository directory with cd zulip-terminal and configure and fetch the upstream remote repository for your cloned fork of Zulip Terminal:

$ git remote add -f upstream https://github.com/zulip/zulip-terminal.git

For detailed explanation on the commands used for cloning and setting upstream, refer to Step 1 of the Get Zulip Code section of Zulip's Git guide.

Setting up a development environment

Various options are available; we are exploring the benefits of each and would appreciate feedback on which you use or feel works best.

Note that the tools used in each case are typically the same, but are called in different ways.

The following commands should be run in the repository directory, created by a process similar to that in the previous section.

Pipenv

  1. Install pipenv (see the recommended installation notes; pipenv can be installed in a virtual environment, if you wish)
$ pip3 install --user pipenv
  1. Initialize the pipenv virtual environment for zulip-term (using the default python 3; use eg. --python 3.6 to be more specific)
$ pipenv --three
  1. Install zulip-term, with the development requirements
$ pipenv install --dev
$ pipenv run pip3 install -e '.[dev]'
  1. Connect the gitlint commit-message hook
$ pipenv run gitlint install-hook

Pip

  1. Manually create & activate a virtual environment; any method should work, such as that used in the above simple installation

    1. python3 -m venv zt_venv (creates a venv named zt_venv in the current directory)
    2. source zt_venv/bin/activate (activates the venv; this assumes a bash-like shell)
  2. Install zulip-term, with the development requirements

$ pip3 install -e '.[dev]'
  1. Connect the gitlint commit-message hook
$ gitlint install-hook

make/pip

This is the newest and simplest approach, if you have make installed:

  1. make (sets up an installed virtual environment in zt_venv in the current directory)
  2. source zt_venv/bin/activate (activates the venv; this assumes a bash-like shell)
  3. gitlint install-hook (connect the gitlint commit-message hook)

Development tasks

Once you have a development environment set up, you might find the following useful, depending upon your type of environment:

Task Make & Pip Pipenv
Run normally zulip-term pipenv run zulip-term
Run in debug mode zulip-term -d pipenv run zulip-term -d
Run with profiling zulip-term --profile pipenv run zulip-term --profile
Run all linters ./tools/lint-all pipenv run ./tools/lint-all
Run all tests pytest pipenv run pytest
Build test coverage report pytest --cov-report html:cov_html --cov=./ pipenv run pytest --cov-report html:cov_html --cov=./

If using make with pip, running make will ensure the development environment is up to date with the specified dependencies, useful after fetching from git and rebasing.

Editing the source

Pick your favorite text editor or development environment!

The source includes an .editorconfig file which enables many editors to automatically configure themselves to produce files which meet the minimum requirements for the project. See https://editorconfig.org for editor support; note that some may require plugins if you wish to use this feature.

Running linters and automated tests

The linters and automated tests (pytest) are automatically run in CI (GitHub Actions) when you submit a pull request (PR), or push changes to an existing pull request.

However, running these checks on your computer can speed up your development by avoiding the need to repeatedly push your code to GitHub. Commands to achieve this are listed in the table of development tasks above (individual linters may also be run via scripts in tools/).

In addition, if using a make-based system:

  • make lint and make test run all of each group of tasks
  • make check runs all checks, which is useful before pushing a PR (or an update)
  • tools/check-branch will run make check on each commit in your branch

NOTE: It is highly unlikely that a pull request will be merged, until all linters and tests are passing, including on a per-commit basis.

The linters and tests aren't passing on my branch/PR - what do I do?

Correcting some linting errors requires manual intervention, such as from mypy for type-checking.

For tips on testing, please review the section further below regarding pytest.

However, other linting errors may be fixed automatically, as detailed below - this can save a lot of time manually adjusting your code to pass the linters!

If you have troubles understanding why the linters or pytest are failing, please do push your code to a branch/PR and we can discuss the problems in the PR or on chat.zulip.org.

Automatically updating hotkeys & file docstrings, vs related documentation

If you update these, note that you do not need to update the text in both places manually to pass linting.

The source of truth is in the source code, so simply update the python file and run the relevant tool. Currently we have:

  • tools/lint-hotkeys --fix to regenerate docs/hotkeys.md from config/keys.py
  • tools/lint-docstring --fix to regenerate docs/developer-file-overview.md from file docstrings

(these tools are also used for the linting process, to ensure that these files are synchronized)

Automatically formatting code

The project uses black and isort for code-style and import sorting respectively.

These tools can be run as linters locally, but can also automatically format your code for you.

If you're using a make-based setup, running make fix will run both (and a few other tools) and reformat the current state of your code - so you'll want to commit first just in case, then --amend that commit if you're happy with the changes.

You can also use the tools individually on a file or directory, eg. black zulipterminal or isort tests/model/test_model.py

Structuring Commits - speeding up reviews, merging & development

As you work locally, investigating changes to make, it's common to make a series of small commits to store your progress. Often this can include commits that fix linting or testing issues in the previous commit(s). These are developmental-style commits - and almost everyone is likely to write commits in this style to some degree.

Developmental-style commits store the changes just fine for you right now. However, when sharing your code, commit messages are a great place to instead communicate to others what you're changing and why. Tidying the structure can also make it easier and quicker for a reader to understand changes, and that you respect their time. One example is that very large single commits can take a lot of time to review, compared to if they are split up. Another is if you fix the tests/linting in a commit: which commit (or commits!) does this fix, and if it's in the same branch/PR, why isn't the original commit just fixed instead?

Therefore, when creating a Pull Request (PR), please consider that your code is more likely to be merged, more quickly, if it is easier to read, understand and review - and a big part of that is how you structure your changes into commits, and describe those changes in commit messages.

To be productive and make it easier for your PRs to be reviewed and updated, we follow an approach taken at Zulip and elsewhere, aiming for PRs to consist of a series of minimal coherent commits:

  • Minimal: Look at each commit. Does it make different kinds of changes to lots of files? Are you treating the title of a commit as a list of changes? Consider how to break down a large change into a sequence of smaller changes that you can individually easily describe and that can flow after one another.
  • Coherent: Each commit should individually pass all linting and existing automated tests, and if you add new behavior, then add or extend the tests to cover it.

Note that keeping to these principles can give other benefits, both before, during and after reviewing a PR, including:

  • Minimal commits can always later be squashed (combined) together - splitting commits is more challenging!
  • Coherent commits mean nothing should be broken between and after commits
    • If a new commit in your branch breaks the linting/tests, it's likely that commit at fault!
    • This improves the utility of git bisect in your branch or on main
  • These commits are easier to reorder in a branch
    • Commits at the start of a branch (or can be moved there), may be merged early to simplify a branch
  • Understanding what changes were made and why is easier when reading a git log comprising these commits

We now enforce a limited aspect of the coherent nature of commits in a PR in a job as part of our Continuous Integration (CI), Ensure isolated PR commits, which essentially runs make check on each commit in your branch. You can replicate this locally before pushing to GitHub using tools/check-branch.

While small or proof-of-concept PRs are initially fine to push as they are, they will likely only be reviewed based on the overall changes. Generally if individual commits look like they have a developmental style then reviewers are likely to give less specific feedback, and minimal coherent commits are certain to be requested before merging.

Restructuring commands - Most restructuring relies upon interactive rebasing (eg. git rebase -i upstream/main), but consider searching online for specific actions, as well as searching or asking in #git help or #learning on chat.zulip.org.

Self review - Another useful approach is to review your own commits both locally (see Zulip suggestions) and after you push to GitHub. This allows you to inspect and fix anything that looks out of place, which someone is likely to pick up in their review, helping your submissions look more polished, as well as again indicating that you respect reviewers' time.

Commit Message Style

We aim to follow a standard commit style to keep the git log consistent and easy to read.

Much like working with code, we suggest you refer to recent commits in the git log, for examples of the style we're actively using.

Our overall style for commit messages broadly follows the general guidelines given for Zulip Commit messages, so we recommend reading that first.

Our commit titles (summaries) have slight variations from the general Zulip style, with each:

  • starting with one or more areas - in lower case, followed by a colon and space
    • generally each commit has at least one area of each modified file - without extensions, separated by a /
    • generally don't include test files in this list (instead Tests updated or Tests added in the commit text)
    • other common areas include types like refactor:, bugfix: and requirements: (see below)
  • ending with a concise description starting with a capital and ending with a full-stop (period)
  • having a maximum overall length of 72 (fitting the github web interface without abbreviation)

Some example commit titles: (ideally more descriptive in practice!)

  • file3/file1/file2: Improve behavior of something.
    • a general commit updating files file1.txt, file2.py and file3.md
  • refactor: file1/file2: Extract some common function.
    • a pure refactor which doesn't change the functional behavior, involving file1.py and file2.py
  • bugfix: file1: Avoid some noticeable bug.
    • a small commit to fix a bug in file1.py
  • tests: file1: Improve test for something.
    • only improve tests for file1, likely in test_file1.py
  • requirements: Upgrade some-dependency from ==9.2 to ==9.3.
    • upgrade a dependency from version ==9.2 to version ==9.3, in the central dependencies file (not some file requirements.*)

To aid in satisfying some of these rules you can use GitLint, as described in the following section.

However, please check your commits manually versus these style rules, since GitLint cannot check everything - including language or grammar!

GitLint

The gitlint tool is installed by default in the development environment, and can help ensure that your commits meet the expected standard.

The tool can check specific commits manually, eg. gitlint for the latest commit, or gitlint --commits main.. for commits leading from main. However, we highly recommend running gitlint install-hook to install the gitlint commit-message hook (or pipenv run gitlint install-hook with pipenv setups).

If the hook is installed as described above, then after completing the text for a commit, it will be checked by gitlint against the style we have set up, and will offer advice if there are any issues it notices. If gitlint finds any, it will ask if you wish to commit with the message as it is (y for 'yes'), stop the commit process (n for 'no'), or edit the commit message (e for 'edit').

While the content still depends upon your writing skills, this ensures a more consistent formatting structure between commits, including by different authors.

Tips for working with tests (pytest)

Tests for zulip-terminal are written using pytest. You can read the tests in the /tests folder to learn about writing tests for a new class/function. If you are new to pytest, reading its documentation is definitely recommended.

We currently have thousands of tests which get checked upon running pytest. While it is dependent on your system capability, this should typically take less than one minute to run. However, during debugging you may still wish to limit the scope of your tests, to improve the turnaround time:

  • If lots of tests are failing in a very verbose way, you might try the -x option (eg. pytest -x) to stop tests after the first failure; due to parametrization of tests and test fixtures, many apparent errors/failures can be resolved with just one fix! (try eg. pytest --maxfail 3 for a less-strict version of this)

  • To avoid running all the successful tests each time, along with the failures, you can run with --lf (eg. pytest --lf), short for --last-failed (similar useful options may be --failed-first and --new-first, which may work well with -x)

  • Since pytest 3.10 there is --sw (--stepwise), which works through known failures in the same way as --lf and -x can be used, which can be combined with --stepwise-skip to control which test is the current focus

  • If you know the names of tests which are failing and/or in a specific location, you might limit tests to a particular location (eg. pytest tests/model) or use a selected keyword (eg. pytest -k __handle)

When only a subset of tests are running it becomes more practical and useful to use the -v option (--verbose); instead of showing a . (or F, E, x, etc) for each test result, it gives the name (with parameters) of each test being run (eg. pytest -v -k __handle). This option also shows more detail in tests and can be given multiple times (eg. pytest -vv).

For additional help with pytest options see pytest -h, or check out the full pytest documentation.

Debugging Tips

Output using print

The stdout (standard output) for zulip-terminal is redirected to ./debug.log if debugging is enabled at run-time using -d or --debug.

This means that if you want to check the value of a variable, or perhaps indicate reaching a certain point in the code, you can simply use print(), eg.

print(f"Just about to do something with {variable}")

and when running with a debugging option, the string will be printed to ./debug.log.

With a bash-like terminal, you can run something like tail -f debug.log in another terminal, to see the output from print as it happens.

Interactive debugging using pudb & telnet

If you want to debug zulip-terminal while it is running, or in a specific state, you can insert

from pudb.remote import set_trace
set_trace()

in the part of the code you want to debug. This will start a telnet connection for you. You can find the IP address and port of the telnet connection in ./debug.log. Then simply run

$ telnet 127.0.0.1 6899

in another terminal, where 127.0.0.1 is the IP address and 6899 is port you find in ./debug.log.

There's no effect in Zulip Terminal after making local changes!

This likely means that you have installed both normal and development versions of zulip-terminal.

To ensure you run the development version:

  • If using pipenv, call pipenv run zulip-term from the cloned/downloaded zulip-terminal directory;

  • If using pip (pip3), ensure you have activated the correct virtual environment (venv); depending on how your shell is configured, the name of the venv may appear in the command prompt. Note that not including the -e in the pip3 command will also cause this problem.

zulip-terminal's People

Stargazers

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

Watchers

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

zulip-terminal's Issues

Test running (without dev packages) in CI?

From what I can tell, all the current CI tests are there to run the actual tests. As such, they install all the dependencies for testing, and don't test without these. Perhaps we need to just depend upon user reports to resolve this, but it seems there should be a better way - running headless and look for exceptions re missing packages, perhaps?

Show hint for pressing SHIFT for selecting with the mouse.

Currently, trying to select anything with a mouse in zulip-terminal immediately deselects the text in xterm. The solution is to provide a hint for the following detail:

Most terminal UI frameworks implement pressing SHIFT and then dragging to select text as you would expect (passing that mouse input to your terminal emulator).

I believe we do not have any use of selecting text in zt so far, so it could be possible to attach an event listener and then show a small message hinting them to use SHIFT and select.

Conversation that inspired the issue: https://chat.zulip.org/#narrow/stream/206-zulip-terminal/topic/xterm.20copy.2Fpaste.3F

Make links clickable

Clicking on a link in a message, makes the thread active. But, it would be nice to allow users to open a link by clicking on it.

Improve debugging experience for zulip-terminal.

Current developers can print variables in zulip-terminal which are logged in /tmp/debug.log. We can use logging module provided by python to log some of the data by default in /var/log/zulip-term/error.log and similar files.

@neiljp FYI

Clarify & document how to quit

Splitting out a second part of issue #176, where it was asked whether ctrl c was the expected way to quit. I've tended to use this in the past, but it would be good to:

  • confirm if this is the only/best key to use
  • document this in README.md
  • include this in the in-app help documentation by adding it to config/keys.py

Write developer documentation for zulip-terminal.

Things we should include:

  • What is urwid(point to their documentation)?
  • Tips for getting started with urwid.
  • How to write/run tests?
  • Contribution guidelines.
  • How to debug easily?(Pudb/pdb)
  • Tutorial

Implement "Unread counts and the pointer"

Useful links:
http://zulip.readthedocs.io/en/latest/subsystems/pointer.html
https://chat.zulip.org/#narrow/stream/127-integrations/subject/ZULIP.20CLI/near/520604

CURRENT STATUS:
Both unread counts and pointer are currently implemented in ZT but there are a few bugs which needs to be taken care of:

  • Ignore Muted streams and topics count. (tracked in #74)
  • Moving between different narrows keeps track of pointer but sometimes get's lost. Those cases need to be tracked here.

Installing Error ( Add support for python >3.6 )

Running zulip-term gives error

Traceback (most recent call last):
File "/Users/omkaryadav/Documents/project/zulip/evnterm/bin/zulip-term"
, line 7, in
from zulipterminal.cli.run import main
File "/Users/omkaryadav/Documents/project/zulip/evnterm/lib/python3.7/s
ite-packages/zulipterminal/cli/run.py", line 9, in
from zulipterminal.core import Controller
File "/Users/omkaryadav/Documents/project/zulip/evnterm/lib/python3.7/s
ite-packages/zulipterminal/core.py", line 10
from zulipterminal.helper import async
^
SyntaxError: invalid syntax

Investigate why keys such as 'ctrl s' do not appear to work in config.py.

In #164 I was hoping to use 'ctrl s' as the mapping for toggling starred messages, as with the zulip webapp. However, this does not currently seem to work; for now I've put an alternative key in, but this may impact other cases where we wish to use keys with modifiers ('ctrl' or otherwise), so should probably be investigated.

My guess was that this might be related to urwid-readline interfering, but I've not confirmed this.

Remove redundant recipient bars when narrowed in PM / Streams.

Currently ZT only clubs those messages it can see, or removes recipient bars for the current message based on the past message. This should be implemented as in Web app.

  • Remove redundant recipient bars as in Web app.
  • Add a current message stream and topic ( or name of user ) info at the top of ZT.

Split recipient header and Search field in top bar of MessageView when too long

When the topic is long, or many private recipients, and/or the window is narrow, this can lead to the column for search becoming tall and thin, eg.

 โ€ข All messages 790      โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ Users โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
 โ€ข Private messages      โ”‚production help > Email Gateway Stripping Number   Sโ”‚โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
                         โ”‚                                                   eโ”‚Search people
                         โ”‚                                                   aโ”‚โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ Streams โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”‚                                                   rโ”‚โ€ข 1403865278
โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”‚                                                   cโ”‚โ€ข Aaditya Arora
Search streams           โ”‚                                                   hโ”‚โ€ข Abhigyan Khaund
โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”‚                                                   :โ”‚โ€ข Abhishek Kumar Singh
 # announce              โ”‚                                                    โ”‚โ€ข Abhishek P
 # automated testing     โ”‚โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”‚โ€ข Achiv Chauhan

Rather than rely on columns, we might try another widget - maybe GridFlow would work here?

Create extended user mention syntax when needed.

Recently, in zulip/zulip#10243 we merged support for the following mention syntax to zulip/zulip:

@**Full Name|1234(id)**

This is to allow us to mention users with the same full name, and is optional. The web app intelligently adds the new syntax only when the users have the same full name, and uses the simpler syntax for others.

Example: https://chat.zulip.org/#narrow/stream/7-test-here/topic/user.20mention

We should:

  1. Add support for this syntax in the terminal client.
  2. Ensure that it is behind a feature flag because it would break mentions in older servers/any non CZO server for now.

Show message info on pressing `i`.

Display the focused message's info on pressing i. Message info should comprise of:

  • Sender details
  • Message Edit History
  • Details of emoji - who reacted
    ...

Fix issues with message merging (hiding content headers) based on star status

When two messages have identical author and very similar date/time, messages are shown adjacently, without repeating either information. These messages appear 'merged', though will highlight separately when scrolled through.

Starring/unstarring a message should 'split' any merged messages, but currently does not do so reliably. The rationale for this is that the content header applies to the entire (apparent) message, or group of messages, and this includes the star marker.

In addition, if a message is separate, it should not just have a star/no-star status, ie. no repeated author/datetime but a * (or no star); rather, probably the datetime should be repeated.

The code handling this is entirely in the MessageBox class main_view function.

pipsi instructions seem to result in Python 2 being used

I thus get an exception trying to run zulip-term.

tabbott@zaset:~/zulip-terminal$ cat ~/.local/bin/zulip-term
#!/home/tabbott/.local/venvs/zulipterminal/bin/python2

# -*- coding: utf-8 -*-
import re
import sys

from zulipterminal.cli.run import main

if __name__ == '__main__':
    sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
    sys.exit(main())

UI Improvements

Left sidebar:

  • could be wider on wider screens. Ideally stream names that fit on web should be fully visible on ZT left sidebar as well

  • stream name overflow should indent or I think I would just do: very very long stream na...

  • I would glue the unread count to the right edge of the sidebar, and make it more visible.

  • Blinking cursor is confusing (the fact that you get a blinking cursor) -- urwid doesn't provide option to turn off blinking cursor or hide cursor, could use more deep diving.

  • Blue highlight makes the stream name hard to read on some terminal profiles

  • I think it's a bit confusing that hitting "Enter" on a stream name removes the left sidebar

Help menu

  • ? menu: too wide, and the break in _____ _____ is confusing. I would also reorder this a bit; we can chat separately.
  • This is a big project but I think super high valuable: make the default suggestion context-dependent.
  • I would make the default suggestion highlight n and r instead of @

Message feed:

  • Grey highlight for message in focus is not great; it makes the message too unreadable
  • For replying to a message, I would consider making the top of the compose box something like zulip-terminal > **feedback**

Explore alternative key bindings for sending messages

Hi,
Um yeah, quick thing. On my platform Alt-Enter (meta-enter) is captured by my console host (for full screen). How does one customize the binding? As it seems right now, I have no way to send messages in this client. ๐Ÿคทโ€โ™‚๏ธ

OS: Ubuntu 18.04 bionic [Ubuntu on Windows 10]
Kernel: x86_64 Linux 4.4.0-17134-Microsoft
Python: 3.6.6
Zulip-Terminal: Fresh from pip as of today (18-11-29)

While I'm asking, is there a better quit then ctrl-c?
Thanks!

Crash on hitting narrow to stream on pvt message by wel_bot

Abrupt crash if you press (s) i.e 'narrow to stream' on the private message sent by welcome bot on startup

Traceback

(most recent call last):
File "/home/kaushik/zulip-terminal/zulipterminal/cli/run.py", line 128, in main
Controller(zuliprc_path, zterm['theme']).main()
File "/home/kaushik/zulip-terminal/zulipterminal/core.py", line 282, in main
self.loop.run()
File "/home/kaushik/.virtualenvs/zulip-terminal-HLs0K9Db/lib/python3.6/site-packages/urwid/main_loop.py", line 286, in run
self._run()
File "/home/kaushik/.virtualenvs/zulip-terminal-HLs0K9Db/lib/python3.6/site-packages/urwid/main_loop.py", line 384, in _run
self.event_loop.run()
File "/home/kaushik/.virtualenvs/zulip-terminal-HLs0K9Db/lib/python3.6/site-packages/urwid/main_loop.py", line 788, in run
self._loop()
File "/home/kaushik/.virtualenvs/zulip-terminal-HLs0K9Db/lib/python3.6/site-packages/urwid/main_loop.py", line 825, in _loop
self._watch_filesfd
File "/home/kaushik/.virtualenvs/zulip-terminal-HLs0K9Db/lib/python3.6/site-packages/urwid/raw_display.py", line 404, in
event_loop, callback, self.get_available_raw_input())
File "/home/kaushik/.virtualenvs/zulip-terminal-HLs0K9Db/lib/python3.6/site-packages/urwid/raw_display.py", line 502, in parse_input
callback(processed, processed_codes)
File "/home/kaushik/.virtualenvs/zulip-terminal-HLs0K9Db/lib/python3.6/site-packages/urwid/main_loop.py", line 411, in _update
self.process_input(keys)
File "/home/kaushik/.virtualenvs/zulip-terminal-HLs0K9Db/lib/python3.6/site-packages/urwid/main_loop.py", line 511, in process_input
k = self._topmost_widget.keypress(self.screen_size, k)
File "/home/kaushik/zulip-terminal/zulipterminal/ui.py", line 222, in keypress
return super(View, self).keypress(size, key)
File "/home/kaushik/.virtualenvs/zulip-terminal-HLs0K9Db/lib/python3.6/site-packages/urwid/container.py", line 1131, in keypress
return self.body.keypress( (maxcol, remaining), key )
File "/home/kaushik/.virtualenvs/zulip-terminal-HLs0K9Db/lib/python3.6/site-packages/urwid/container.py", line 2271, in keypress
key = w.keypress((mc,) + size[1:], key)
File "/home/kaushik/.virtualenvs/zulip-terminal-HLs0K9Db/lib/python3.6/site-packages/urwid/container.py", line 1590, in keypress
key = self.focus.keypress(tsize, key)
File "/home/kaushik/.virtualenvs/zulip-terminal-HLs0K9Db/lib/python3.6/site-packages/urwid/container.py", line 2271, in keypress
key = w.keypress((mc,) + size[1:], key)
File "/home/kaushik/zulip-terminal/zulipterminal/ui_tools/views.py", line 350, in keypress
return super(MiddleColumnView, self).keypress(size, key)
File "/home/kaushik/.virtualenvs/zulip-terminal-HLs0K9Db/lib/python3.6/site-packages/urwid/container.py", line 1131, in keypress
return self.body.keypress( (maxcol, remaining), key )
File "/home/kaushik/zulip-terminal/zulipterminal/ui_tools/views.py", line 136, in keypress
key = super(MessageView, self).keypress(size, key)
File "/home/kaushik/.virtualenvs/zulip-terminal-HLs0K9Db/lib/python3.6/site-packages/urwid/listbox.py", line 999, in keypress
key = focus_widget.keypress((maxcol,),key)
File "/home/kaushik/zulip-terminal/zulipterminal/ui_tools/boxes.py", line 363, in keypress
self.model.controller.narrow_to_user(self)
File "/home/kaushik/zulip-terminal/zulipterminal/core.py", line 187, in narrow_to_user
button.user_id = self.model.user_dict[user_emails]['user_id']
KeyError: '[email protected]'
Zulip Terminal has crashed!
You can ask for help at:
https://chat.zulip.org/#narrow/stream/206-zulip-terminal

Thanks for using the Zulip-Terminal interface.

Add a box around message in focus.

Currently, when a message is in focus, it's colour is changed to red. We can add a LineBox widget around the message in focus to make it visually appealing.

Set a proper User-Agent

We should set a user-agent for the Zulip-terminal client. The style we use for other apps would be e.g. ZulipTerminal/0.1.0 <anything else>, where <anything else> (the content after a space) can have details like the OS. The key part that is parsed by the server for things like the /stats graphs is the part before the space, and we use that capitalization styling.

Fixing this will both make zulip-terminal appear nicely on /stats as well as making it easier to grep for in server logs.

Crash when trying to read a muted stream

Traceback (most recent call last):
  File "/run/current-system/sw/lib/python3.7/threading.py", line 917, in _bootstrap_inner
    self.run()
  File "/run/current-system/sw/lib/python3.7/threading.py", line 865, in run
    self._target(*self._args, **self._kwargs)
  File "/home/rht/code/venv/lib/python3.7/site-packages/zulip_term-0.3.1-py3.7.egg/zulipterminal/ui_tools/views.py", line 73, in load_old_messages
    self.set_focus(self.focus_msg)  # Return focus to original message
  File "/home/rht/code/venv/lib/python3.7/site-packages/urwid/listbox.py", line 578, in set_focus
    raise IndexError("Can't set focus, ListBox is empty")
IndexError: Can't set focus, ListBox is empty

Nasty error message when starting up ZT while offline

    Welcome to Zulip.
Loading |Invalid API key
Exception in thread Thread-2:
Traceback (most recent call last):
  File "/home/rht/code/venv/lib/python3.7/site-packages/urllib3/connection.py", line 171, in _new_conn
    (self._dns_host, self.port), self.timeout, **extra_kw)
  File "/home/rht/code/venv/lib/python3.7/site-packages/urllib3/util/connection.py", line 79, in create_connection
    raise err
  File "/home/rht/code/venv/lib/python3.7/site-packages/urllib3/util/connection.py", line 69, in create_connection
    sock.connect(sa)
OSError: [Errno 101] Network is unreachable

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/rht/code/venv/lib/python3.7/site-packages/urllib3/connectionpool.py", line 600, in urlopen
    chunked=chunked)
  File "/home/rht/code/venv/lib/python3.7/site-packages/urllib3/connectionpool.py", line 343, in _make_request
    self._validate_conn(conn)
  File "/home/rht/code/venv/lib/python3.7/site-packages/urllib3/connectionpool.py", line 849, in _validate_conn
    conn.connect()
  File "/home/rht/code/venv/lib/python3.7/site-packages/urllib3/connection.py", line 314, in connect
    conn = self._new_conn()
  File "/home/rht/code/venv/lib/python3.7/site-packages/urllib3/connection.py", line 180, in _new_conn
    self, "Failed to establish a new connection: %s" % e)
urllib3.exceptions.NewConnectionError: <urllib3.connection.VerifiedHTTPSConnection object at 0x7f1fc432c6d8>: Failed to establish a new connection: [Errno 101] Network is unreachable

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/run/current-system/sw/lib/python3.7/site-packages/requests/adapters.py", line 445, in send
    timeout=timeout
  File "/home/rht/code/venv/lib/python3.7/site-packages/urllib3/connectionpool.py", line 638, in urlopen
    _stacktrace=sys.exc_info()[2])
  File "/home/rht/code/venv/lib/python3.7/site-packages/urllib3/util/retry.py", line 398, in increment
    raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='chat.zulip.org', port=443): Max retries exceeded with url: /api/v1/register (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x7f1fc432c6d8>: Failed to establish a new connection: [Errno 101] Network is unreachable'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/rht/code/venv/lib/python3.7/site-packages/zulip/__init__.py", line 552, in do_api_query
    **kwargs)
  File "/run/current-system/sw/lib/python3.7/site-packages/requests/sessions.py", line 512, in request
    resp = self.send(prep, **send_kwargs)
  File "/run/current-system/sw/lib/python3.7/site-packages/requests/sessions.py", line 622, in send
    r = adapter.send(request, **kwargs)
  File "/run/current-system/sw/lib/python3.7/site-packages/requests/adapters.py", line 513, in send
    raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPSConnectionPool(host='chat.zulip.org', port=443): Max retries exceeded with url: /api/v1/register (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x7f1fc432c6d8>: Failed to establish a new connection: [Errno 101] Network is unreachable'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/run/current-system/sw/lib/python3.7/threading.py", line 917, in _bootstrap_inner
    self.run()
  File "/run/current-system/sw/lib/python3.7/threading.py", line 865, in run
    self._target(*self._args, **self._kwargs)
  File "/home/rht/code/venv/lib/python3.7/site-packages/zulip_term-0.2.1+git-py3.7.egg/zulipterminal/core.py", line 264, in register_initial_desired_events
    apply_markdown=True)
  File "/home/rht/code/venv/lib/python3.7/site-packages/zulip/__init__.py", line 754, in register
    request=request,
  File "/home/rht/code/venv/lib/python3.7/site-packages/zulip/__init__.py", line 619, in call_endpoint
    longpolling=longpolling, files=files)
  File "/home/rht/code/venv/lib/python3.7/site-packages/zulip/__init__.py", line 582, in do_api_query
    raise ZulipError('cannot connect to server ' + self.base_url)
zulip.ZulipError: cannot connect to server https://chat.zulip.org/api/
Exception in thread Thread-4:
Traceback (most recent call last):
  File "/home/rht/code/venv/lib/python3.7/site-packages/urllib3/connection.py", line 171, in _new_conn
    (self._dns_host, self.port), self.timeout, **extra_kw)
  File "/home/rht/code/venv/lib/python3.7/site-packages/urllib3/util/connection.py", line 79, in create_connection
    raise err
  File "/home/rht/code/venv/lib/python3.7/site-packages/urllib3/util/connection.py", line 69, in create_connection
    sock.connect(sa)
OSError: [Errno 101] Network is unreachable

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/rht/code/venv/lib/python3.7/site-packages/urllib3/connectionpool.py", line 600, in urlopen
    chunked=chunked)
  File "/home/rht/code/venv/lib/python3.7/site-packages/urllib3/connectionpool.py", line 343, in _make_request
    self._validate_conn(conn)
  File "/home/rht/code/venv/lib/python3.7/site-packages/urllib3/connectionpool.py", line 849, in _validate_conn
    conn.connect()
  File "/home/rht/code/venv/lib/python3.7/site-packages/urllib3/connection.py", line 314, in connect
    conn = self._new_conn()
  File "/home/rht/code/venv/lib/python3.7/site-packages/urllib3/connection.py", line 180, in _new_conn
    self, "Failed to establish a new connection: %s" % e)
urllib3.exceptions.NewConnectionError: <urllib3.connection.VerifiedHTTPSConnection object at 0x7f1fc4356358>: Failed to establish a new connection: [Errno 101] Network is unreachable

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/run/current-system/sw/lib/python3.7/site-packages/requests/adapters.py", line 445, in send
    timeout=timeout
  File "/home/rht/code/venv/lib/python3.7/site-packages/urllib3/connectionpool.py", line 638, in urlopen
    _stacktrace=sys.exc_info()[2])
  File "/home/rht/code/venv/lib/python3.7/site-packages/urllib3/util/retry.py", line 398, in increment
    raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='chat.zulip.org', port=443): Max retries exceeded with url: /json/messages?anchor=0&num_before=30&num_after=10&apply_markdown=true&use_first_unread_anchor=true&client_gravatar=false&narrow=%5B%5D (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x7f1fc4356358>: Failed to establish a new connection: [Errno 101] Network is unreachable'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/rht/code/venv/lib/python3.7/site-packages/zulip/__init__.py", line 552, in do_api_query
    **kwargs)
  File "/run/current-system/sw/lib/python3.7/site-packages/requests/sessions.py", line 512, in request
    resp = self.send(prep, **send_kwargs)
  File "/run/current-system/sw/lib/python3.7/site-packages/requests/sessions.py", line 622, in send
    r = adapter.send(request, **kwargs)
  File "/run/current-system/sw/lib/python3.7/site-packages/requests/adapters.py", line 513, in send
    raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPSConnectionPool(host='chat.zulip.org', port=443): Max retries exceeded with url: /json/messages?anchor=0&num_before=30&num_after=10&apply_markdown=true&use_first_unread_anchor=true&client_gravatar=false&narrow=%5B%5D (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x7f1fc4356358>: Failed to establish a new connection: [Errno 101] Network is unreachable'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/run/current-system/sw/lib/python3.7/threading.py", line 917, in _bootstrap_inner
    self.run()
  File "/run/current-system/sw/lib/python3.7/threading.py", line 865, in run
    self._target(*self._args, **self._kwargs)
  File "/home/rht/code/venv/lib/python3.7/site-packages/zulip_term-0.2.1+git-py3.7.egg/zulipterminal/model.py", line 194, in get_messages
    method="GET")
  File "/home/rht/code/venv/lib/python3.7/site-packages/zulip/__init__.py", line 582, in do_api_query
    raise ZulipError('cannot connect to server ' + self.base_url)
zulip.ZulipError: cannot connect to server https://chat.zulip.org/api/

Exception in thread Thread-5:
Traceback (most recent call last):
  File "/home/rht/code/venv/lib/python3.7/site-packages/urllib3/connection.py", line 171, in _new_conn
    (self._dns_host, self.port), self.timeout, **extra_kw)
  File "/home/rht/code/venv/lib/python3.7/site-packages/urllib3/util/connection.py", line 79, in create_connection
    raise err
  File "/home/rht/code/venv/lib/python3.7/site-packages/urllib3/util/connection.py", line 69, in create_connection
    sock.connect(sa)
OSError: [Errno 101] Network is unreachable

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/rht/code/venv/lib/python3.7/site-packages/urllib3/connectionpool.py", line 600, in urlopen
    chunked=chunked)
  File "/home/rht/code/venv/lib/python3.7/site-packages/urllib3/connectionpool.py", line 343, in _make_request
    self._validate_conn(conn)
  File "/home/rht/code/venv/lib/python3.7/site-packages/urllib3/connectionpool.py", line 849, in _validate_conn
    conn.connect()
  File "/home/rht/code/venv/lib/python3.7/site-packages/urllib3/connection.py", line 314, in connect
    conn = self._new_conn()
  File "/home/rht/code/venv/lib/python3.7/site-packages/urllib3/connection.py", line 180, in _new_conn
    self, "Failed to establish a new connection: %s" % e)
urllib3.exceptions.NewConnectionError: <urllib3.connection.VerifiedHTTPSConnection object at 0x7f1fc432c898>: Failed to establish a new connection: [Errno 101] Network is unreachable

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/run/current-system/sw/lib/python3.7/site-packages/requests/adapters.py", line 445, in send
    timeout=timeout
  File "/home/rht/code/venv/lib/python3.7/site-packages/urllib3/connectionpool.py", line 638, in urlopen
    _stacktrace=sys.exc_info()[2])
  File "/home/rht/code/venv/lib/python3.7/site-packages/urllib3/util/retry.py", line 398, in increment
    raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='chat.zulip.org', port=443): Max retries exceeded with url: /api/v1/users?client_gravatar=true (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x7f1fc432c898>: Failed to establish a new connection: [Errno 101] Network is unreachable'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/rht/code/venv/lib/python3.7/site-packages/zulip/__init__.py", line 552, in do_api_query
    **kwargs)
  File "/run/current-system/sw/lib/python3.7/site-packages/requests/sessions.py", line 512, in request
    resp = self.send(prep, **send_kwargs)
  File "/run/current-system/sw/lib/python3.7/site-packages/requests/sessions.py", line 622, in send
    r = adapter.send(request, **kwargs)
  File "/run/current-system/sw/lib/python3.7/site-packages/requests/adapters.py", line 513, in send
    raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPSConnectionPool(host='chat.zulip.org', port=443): Max retries exceeded with url: /api/v1/users?client_gravatar=true (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x7f1fc432c898>: Failed to establish a new connection: [Errno 101] Network is unreachable'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/run/current-system/sw/lib/python3.7/threading.py", line 917, in _bootstrap_inner
    self.run()
  File "/run/current-system/sw/lib/python3.7/threading.py", line 865, in run
    self._target(*self._args, **self._kwargs)
  File "/home/rht/code/venv/lib/python3.7/site-packages/zulip_term-0.2.1+git-py3.7.egg/zulipterminal/model.py", line 63, in _update_realm_users
  File "/home/rht/code/venv/lib/python3.7/site-packages/zulip/__init__.py", line 821, in get_members
    request=request,
  File "/home/rht/code/venv/lib/python3.7/site-packages/zulip/__init__.py", line 619, in call_endpoint
    longpolling=longpolling, files=files)
  File "/home/rht/code/venv/lib/python3.7/site-packages/zulip/__init__.py", line 582, in do_api_query
    raise ZulipError('cannot connect to server ' + self.base_url)
zulip.ZulipError: cannot connect to server https://chat.zulip.org/api/

Exception in thread Thread-3:
Traceback (most recent call last):
  File "/home/rht/code/venv/lib/python3.7/site-packages/urllib3/connection.py", line 171, in _new_conn
    (self._dns_host, self.port), self.timeout, **extra_kw)
  File "/home/rht/code/venv/lib/python3.7/site-packages/urllib3/util/connection.py", line 79, in create_connection
    raise err
  File "/home/rht/code/venv/lib/python3.7/site-packages/urllib3/util/connection.py", line 69, in create_connection
    sock.connect(sa)
OSError: [Errno 101] Network is unreachable

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/rht/code/venv/lib/python3.7/site-packages/urllib3/connectionpool.py", line 600, in urlopen
    chunked=chunked)
  File "/home/rht/code/venv/lib/python3.7/site-packages/urllib3/connectionpool.py", line 343, in _make_request
    self._validate_conn(conn)
  File "/home/rht/code/venv/lib/python3.7/site-packages/urllib3/connectionpool.py", line 849, in _validate_conn
    conn.connect()
  File "/home/rht/code/venv/lib/python3.7/site-packages/urllib3/connection.py", line 314, in connect
    conn = self._new_conn()
  File "/home/rht/code/venv/lib/python3.7/site-packages/urllib3/connection.py", line 180, in _new_conn
    self, "Failed to establish a new connection: %s" % e)
urllib3.exceptions.NewConnectionError: <urllib3.connection.VerifiedHTTPSConnection object at 0x7f1fc439f7b8>: Failed to establish a new connection: [Errno 101] Network is unreachable

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/run/current-system/sw/lib/python3.7/site-packages/requests/adapters.py", line 445, in send
    timeout=timeout
  File "/home/rht/code/venv/lib/python3.7/site-packages/urllib3/connectionpool.py", line 638, in urlopen
    _stacktrace=sys.exc_info()[2])
  File "/home/rht/code/venv/lib/python3.7/site-packages/urllib3/util/retry.py", line 398, in increment
    raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='chat.zulip.org', port=443): Max retries exceeded with url: /api/v1/users/me (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x7f1fc439f7b8>: Failed to establish a new connection: [Errno 101] Network is unreachable'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/rht/code/venv/lib/python3.7/site-packages/zulip/__init__.py", line 552, in do_api_query
    **kwargs)
  File "/run/current-system/sw/lib/python3.7/site-packages/requests/sessions.py", line 512, in request
    resp = self.send(prep, **send_kwargs)
  File "/run/current-system/sw/lib/python3.7/site-packages/requests/sessions.py", line 622, in send
    r = adapter.send(request, **kwargs)
  File "/run/current-system/sw/lib/python3.7/site-packages/requests/adapters.py", line 513, in send
    raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPSConnectionPool(host='chat.zulip.org', port=443): Max retries exceeded with url: /api/v1/users/me (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x7f1fc439f7b8>: Failed to establish a new connection: [Errno 101] Network is unreachable'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/run/current-system/sw/lib/python3.7/threading.py", line 917, in _bootstrap_inner
    self.run()
  File "/run/current-system/sw/lib/python3.7/threading.py", line 865, in run
    self._target(*self._args, **self._kwargs)
  File "/home/rht/code/venv/lib/python3.7/site-packages/zulip_term-0.2.1+git-py3.7.egg/zulipterminal/model.py", line 58, in _update_user_id
    self.user_id = self.client.get_profile()['user_id']
  File "/home/rht/code/venv/lib/python3.7/site-packages/zulip/__init__.py", line 786, in get_profile
    request=request,
  File "/home/rht/code/venv/lib/python3.7/site-packages/zulip/__init__.py", line 619, in call_endpoint
    longpolling=longpolling, files=files)
  File "/home/rht/code/venv/lib/python3.7/site-packages/zulip/__init__.py", line 582, in do_api_query
    raise ZulipError('cannot connect to server ' + self.base_url)
zulip.ZulipError: cannot connect to server https://chat.zulip.org/api/


Traceback (most recent call last):
  File "/home/rht/code/venv/lib/python3.7/site-packages/urllib3/connection.py", line 171, in _new_conn
    (self._dns_host, self.port), self.timeout, **extra_kw)
  File "/home/rht/code/venv/lib/python3.7/site-packages/urllib3/util/connection.py", line 79, in create_connection
    raise err
  File "/home/rht/code/venv/lib/python3.7/site-packages/urllib3/util/connection.py", line 69, in create_connection
    sock.connect(sa)
OSError: [Errno 101] Network is unreachable

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/rht/code/venv/lib/python3.7/site-packages/urllib3/connectionpool.py", line 600, in urlopen
    chunked=chunked)
  File "/home/rht/code/venv/lib/python3.7/site-packages/urllib3/connectionpool.py", line 343, in _make_request
    self._validate_conn(conn)
  File "/home/rht/code/venv/lib/python3.7/site-packages/urllib3/connectionpool.py", line 849, in _validate_conn
    conn.connect()
  File "/home/rht/code/venv/lib/python3.7/site-packages/urllib3/connection.py", line 314, in connect
    conn = self._new_conn()
  File "/home/rht/code/venv/lib/python3.7/site-packages/urllib3/connection.py", line 180, in _new_conn
    self, "Failed to establish a new connection: %s" % e)
urllib3.exceptions.NewConnectionError: <urllib3.connection.VerifiedHTTPSConnection object at 0x7f1fc432c400>: Failed to establish a new connection: [Errno 101] Network is unreachable

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/run/current-system/sw/lib/python3.7/site-packages/requests/adapters.py", line 445, in send
    timeout=timeout
  File "/home/rht/code/venv/lib/python3.7/site-packages/urllib3/connectionpool.py", line 638, in urlopen
    _stacktrace=sys.exc_info()[2])
  File "/home/rht/code/venv/lib/python3.7/site-packages/urllib3/util/retry.py", line 398, in increment
    raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='chat.zulip.org', port=443): Max retries exceeded with url: /api/v1/register (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x7f1fc432c400>: Failed to establish a new connection: [Errno 101] Network is unreachable'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/rht/code/venv/lib/python3.7/site-packages/zulip/__init__.py", line 552, in do_api_query
    **kwargs)
  File "/run/current-system/sw/lib/python3.7/site-packages/requests/sessions.py", line 512, in request
    resp = self.send(prep, **send_kwargs)
  File "/run/current-system/sw/lib/python3.7/site-packages/requests/sessions.py", line 622, in send
    r = adapter.send(request, **kwargs)
  File "/run/current-system/sw/lib/python3.7/site-packages/requests/adapters.py", line 513, in send
    raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPSConnectionPool(host='chat.zulip.org', port=443): Max retries exceeded with url: /api/v1/register (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x7f1fc432c400>: Failed to establish a new connection: [Errno 101] Network is unreachable'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/rht/code/venv/lib/python3.7/site-packages/zulip_term-0.2.1+git-py3.7.egg/zulipterminal/model.py", line 227, in _update_initial_data
    client_gravatar=True,
  File "/home/rht/code/venv/lib/python3.7/site-packages/zulip/__init__.py", line 754, in register
    request=request,
  File "/home/rht/code/venv/lib/python3.7/site-packages/zulip/__init__.py", line 619, in call_endpoint
    longpolling=longpolling, files=files)
  File "/home/rht/code/venv/lib/python3.7/site-packages/zulip/__init__.py", line 582, in do_api_query
    raise ZulipError('cannot connect to server ' + self.base_url)
zulip.ZulipError: cannot connect to server https://chat.zulip.org/api/

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/rht/code/venv/lib/python3.7/site-packages/zulip_term-0.2.1+git-py3.7.egg/zulipterminal/cli/run.py", line 128, in main
    Controller(zuliprc_path, zterm['theme']).main()
  File "/home/rht/code/venv/lib/python3.7/site-packages/zulip_term-0.2.1+git-py3.7.egg/zulipterminal/core.py", line 32, in __init__
    self.model = Model(self)
  File "/home/rht/code/venv/lib/python3.7/site-packages/zulip_term-0.2.1+git-py3.7.egg/zulipterminal/model.py", line 43, in __init__
    self._update_initial_data()
  File "/home/rht/code/venv/lib/python3.7/site-packages/zulip_term-0.2.1+git-py3.7.egg/zulipterminal/model.py", line 236, in _update_initial_data
    raise urwid.ExitMainLoop()
urwid.main_loop.ExitMainLoop
Zulip Terminal has crashed!
You can ask for help at:
https://chat.zulip.org/#narrow/stream/206-zulip-terminal

Thanks for using the Zulip-Terminal interface.

TRACKING: Extend user documentation

  • Supported Features
  • List of common problems with solution
  • A working demo of ZT. ( An image / video )
  • Why use ZT?
  • How to run on windows? ( urwid usesfcntl library which is not available on non-unix platforms.) Recommend using WSL.

Hotkeys interferring with Stream and Title fields

When I write a message and fill out the Stream and Title fields, I am unable to type 'h' in the first and 'l' in the second field because they are interpreted as hotkeys and send me each to the other field respectively.

Implement missing features for editing sent messages.

TODO:

  • propagate_mode: Add support for "change_later" & "change_all". Only "change_one" is supported now. This will also involve changing all the messages' topic after the edited message if a topic change is requested.
  • Disable stream_edit_box and to_edit_box when editing message since they cannot be edited once a message is sent. Making them not editable will reduce confusion too. The best way to do it would be to add disable feature to ReadlineEdit.

Custom API request

This is a feature request for ZT to have option for user to input custom API request to the server (this could either be specified in cfg or in a colon-prefixed command input analogous to vim's command-line mode). This is particularly useful for debug purpose, but additionally could be a basis for adding another feature: a custom shortcut at the left-sidebar that automatically display messages from a search result of a certain keyword. This feature (the custom filter shortcut) has long existed in gmail, in the form of filters/labels.

Keybinds: Same as web/electron?

I feel like the key bindings should be the same across Zulip apps.

For example, I'm missing j and k greatly (my Ergodox keyboard has no arrow keys on the primary layer), but others are missing too. J, K, A, and D also seem pretty useful and should be around.

Implement Push Notifications.

Show Push Notifications for user-mentions, wildcard-mentions and if stream notifications are enabled. Currently zt doesn't receive any flags since the web client treats zt as a bot and doesn't attach any flags to messages. This will be fixed in the release of zulip(i.e, v1.9.0). So we can implement this after this.

Also, we should check if the server isn't sending us any flags for the messages, then probably the server hasn't upgraded their zulip version and we don't display notifications for it either.

Currently there are two libraries we can use to implement this:
on linux: https://pypi.org/project/notify2/
on mac: https://github.com/setem/pync

Ensure client_gravatar=True is always passed when appropriate

I've not reviewed the other client code, but we generally use this flag to avoid the server computing and sending extra data that we don't need - we don't display any gravatars/icons.

There is at least one point in the code (at this time) which has a False being passed; while this is likely not overly significant, I'm not sure if there are other cases which should have this parameter actually passed.

This was discussed previously with @rht, but I wanted to have this open to track it. A simple fix is just one line to change the outstanding obvious parameter, but checking the others is potentially more work, if there is more to check!

Generate hotkeys section/doc using script and check with CI

All the keybindings used by zulip-terminal are stored in zulipterminal/config.py. We can generate README section of the hotkeys by travic CI.

We can create a different section for hotkeys that are imported from urwid and urwid_readline libraries.

Recommend Projects

  • React photo React

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

  • Vue.js photo Vue.js

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

  • Typescript photo Typescript

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

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

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

  • web

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

  • server

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

  • Machine learning

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

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

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

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.