tonsky / tonsky/FiraCode

The lack of context sensitivity

Open
#182 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

stylistic sets
Dominant language
Clojure
Stars
82k
Forks
3.2k
PR merge metrics
No merged PRs in 30d

Description

The major thing which prevents me from using FiraCode, or any other ligature-based programming font for that matter, is their lack of context-sensitivity. I spend a non-trivial amount of time doing text processing inside the shell and the ligatures tend to garble the output in subtle ways. Most problematic are the visually dissimilar ones (such as != rendering as ≠), which add another layer of mental overhead when reading the output rather than making things simpler. However, I do not think this is an unsurmountable issue:

  1. At the barest minimum, there should be terminal escape sequences for turning the ligatures on and off with the default being the off state. Editors like vim could then only switch the OpenType ligatures on, when they are running. I don't know if there already are such escape sequences (I would honestly be surprised, if there were), but I'm willing to look into this.
  2. After that, the next logical step is for the text editor to switch the ligatures on and off based on the language and the kind of tokens they appear in. This would prevent the ligatures from appearing inside string literals and plain text files.
  3. I don't even know whether OpenType has any support for multiple ligature sets or if it would be necessary to extend it, but making the editor switch between language-specific ligature sets based on the current language (rather than just a coarse-grained on- and off-switching) seems like the logical final step. After this step, I think we might just be quite close to a tangible and robust solution.

This is not really a feature request, but rather a discussion topic.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No files, tests, or implementation entry points are named. Start by investigating terminal escape sequences, editor-controlled ligature switching, and OpenType support for the proposed behavior; first establish which part is feasible and agree on a concrete scope before implementation. Done would require an accepted design and corresponding documented behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
shell, vim
Domain
design
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.