在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):cdepillabout/termonad开源软件地址(OpenSource Url):https://github.com/cdepillabout/termonad开源编程语言(OpenSource Language):Haskell 87.4%开源软件介绍(OpenSource Introduction):TermonadTermonad is a terminal emulator configurable in Haskell. It is extremely customizable and provides hooks to modify the default behavior. It can be thought of as the "XMonad" of terminal emulators. Termonad was featured on an episode of DistroTube. This video gives a short overview of Termonad. Table of Contents InstallationTermonad can be installed on any system as long as the necessary GTK libraries are available. The following are instructions for installing Termonad on a few different distributions and systems. If the given steps don't work for you, or you want to add instructions for an additional system, please send a pull request. The following steps use the
Arch LinuxFirst, you must install the required Gnome/GTK system libraries: $ pacman -S vte3 gobject-introspection In order to install Termonad, clone this repository and run $ git clone https://github.com/cdepillabout/termonad
$ cd termonad/
$ stack install Note that Termonad depends on the One problem that Arch users often run into is that their system Gnome/GTK libraries are newer than what the
My suggestion is to use Nix, since it is highly likely to "just work" (because with Nix, all libraries are pinned to known working versions, even system libraries). Ubuntu / DebianTermonad can be installed through $ sudo apt install termonad libghc-termonad-dev Note that the Compiling from source on Ubuntu / DebianFirst, you must install the required Gnome/GTK system libraries: $ apt-get install gobject-introspection libgirepository1.0-dev libgtk-3-dev libvte-2.91-dev libpcre2-dev In order to install Termonad, clone this repository and run $ git clone https://github.com/cdepillabout/termonad
$ cd termonad/
$ stack install NixIf you have The first is using $ nix-env -i stack
$ git clone https://github.com/cdepillabout/termonad
$ cd termonad/
$ stack --nix install (edit: Building with The second is using the normal $ git clone https://github.com/cdepillabout/termonad
$ cd termonad/
$ nix-build Mac OS XBuilding and installing Termonad on Mac OS X should be possible with any of the following three methods:
The following sections describe each method.
Installing with just |
Key binding | Action |
---|---|
Ctrl Shift t | Open new tab. |
Ctrl Shift w | Close tab. |
Ctrl Shift f | Open Find dialog for searching for a regex. |
Ctrl Shift p | Find the regex above the current position. |
Ctrl Shift i | Find the regex below the current position. |
Ctrl + | Increase font size. |
Ctrl - | Decrease font size. |
Ctrl PgUp | Switch to previous tab. |
Ctrl PgDown | Switch to next tab. |
Alt (number key) | Switch to tab number . For example, Alt 2 switches to tab 2. |
Termonad has two different ways to be configured.
The first way is to use the built-in Preferences editor. You can find this in
the Preferences
menu under Edit
in the menubar.
When opening Termonad for the first time, it will create a preferences file at
~/.config/termonad/termonad.yaml
. When you change a setting in the
Preferences editor, Termonad will update the setting in the preferences file.
When running Termonad, it will load settings from the preferences file. Do not edit the preferences file by hand, because it will be overwritten when updating settings in the Preferences editor.
This method is perfect for users who only want to make small changes to the Termonad settings, like the default font size.
The second way to configure Termonad is to use a Haskell-based settings file,
called ~/.config/termonad/termonad.hs
by default. This method allows you to
make large, sweeping changes to Termonad. This method is recommended for power
users.
WARNING: If you have a ~/.config/termonad/termonad.hs
file, then all
settings from ~/.config/termonad/termonad.yaml
will be ignored. If you want
to set ANY settings in ~/.config/termonad/termonad.hs
, then you must
set ALL settings in ~/.config/termonad/termonad.hs
.
The following is an example Termonad configuration file. You should save this to
~/.config/termonad/termonad.hs
. You can find more information on the available
configuration options within the
Termonad.Config
module.
{-# LANGUAGE OverloadedStrings #-}
module Main where
import Termonad.App (defaultMain)
import Termonad.Config
( FontConfig, FontSize(FontSizePoints), Option(Set)
, ShowScrollbar(ShowScrollbarAlways), defaultConfigOptions, defaultFontConfig
, defaultTMConfig, fontConfig, fontFamily, fontSize, options, showScrollbar
)
import Termonad.Config.Colour
( AlphaColour, ColourConfig, addColourExtension, createColour
, createColourExtension, cursorBgColour, defaultColourConfig
)
-- | This sets the color of the cursor in the terminal.
--
-- This uses the "Data.Colour" module to define a dark-red color.
-- There are many default colors defined in "Data.Colour.Names".
cursBgColour :: AlphaColour Double
cursBgColour = createColour 204 0 0
-- | This sets the colors used for the terminal. We only specify the background
-- color of the cursor.
colConf :: ColourConfig (AlphaColour Double)
colConf =
defaultColourConfig
{ cursorBgColour = Set cursBgColour
}
-- | This defines the font for the terminal.
fontConf :: FontConfig
fontConf =
defaultFontConfig
{ fontFamily = "DejaVu Sans Mono"
, fontSize = FontSizePoints 13
}
main :: IO ()
main = do
colExt <- createColourExtension colConf
let termonadConf =
defaultTMConfig
{ options =
defaultConfigOptions
{ fontConfig = fontConf
-- Make sure the scrollbar is always visible.
, showScrollbar = ShowScrollbarAlways
}
}
`addColourExtension` colExt
defaultMain termonadConf
There are other example configuration files in the example-config/ directory.
If you want to test what all the colors look like, you may find it convenient
to use the
print-console-colors
package, which provides an executable called print-console-colors
that prints
all of the colors for your terminal.
If you launch Termonad by calling ~/.local/bin/termonad
, it will try to
compile the ~/.config/termonad/termonad.hs
file if it exists. The problem is
that ~/.local/bin/termonad
needs to be able to see GHC and the required
Haskell libraries to be able to compile ~/.config/termonad/termonad.hs
.
There are a couple solutions to this problem, listed in the sections below.
(These steps are definitely confusing. I would love to figure out a better way to do this. Please submit an issue or PR if you have a good idea about how to fix this.)
stack
If you originally compiled Termonad with stack
, you can use stack
to
execute Termonad. First, you must change to the directory with the Termonad
source code. From there, you can run stack exec
:
$ cd termonad/ # change to the termonad source code directory
$ stack exec -- termonad
stack
will pick up the correct GHC version and libraries from the
stack.yaml
and termonad.cabal
file. termonad
will be run in an
environment with GHC available. termonad
will use this GHC and libraries to
compile your ~/.config/termonad/termonad.hs
file. It if succeeds, it should
create a ~/.cache/termonad/termonad-linux-x86_64
binary.
If you need extra Haskell libraries available when compiling your
~/.config/termonad/termonad.hs
file, you can specify them to stack exec
:
$ stack exec --package lens --package conduit -- termonad
The problem with this is that stack exec
changes quite a few of your
environment variables. It is not recommended to actually run Termonad from
within stack exec
. After you run stack exec -- termonad
and let it
recompile your ~/.config/termonad/termonad.hs
file, exit Termonad.
Re-run Termonad by calling it directly. Termonad will notice that
~/.config/termonad/termonad.hs
hasn't changed since
~/.cache/termonad/termonad-linux-x86_64
has been recompiled, so it will
directly execute ~/.cache/termonad/termonad-linux-x86_64
.
nix
Building Termonad with nix
(by running nix-build
in the top
directory) sets it up so that Termonad can see GHC. Termonad should be able
to compile the ~/.config/termonad/termonad.hs
file by default.
If you're interested in how this works, or want to change which Haskell
packages are available from your ~/.config/termonad/termonad.hs
file, please
see the documentation in the
.nix-helpers/termonad-with-packages.nix
file.
Termonad has the following goals:
fully configurable in Haskell
There are already many good terminal emulators. However, there are no terminal emulators fully configurable in Haskell. Termonad fills this niche.
flexible
Most people only need a terminal emulator that lets you change the font-size, cursor color, etc. They don't need tons of configuration options. Termonad should be for people that like lots of configuration options. Termonad should provide many hooks to allow the user full control over its behavior.
stable
Termonad should be able to be used everyday as your main terminal emulator. It should not crash for any reason. If you experience a crash, please file an issue or a pull request!
good documentation
The documentation for Termonad on Hackage should be good. You shouldn't have to guess at what certain data types or functions do. If you have a hard time understanding anything in the documentation, please submit an issue or PR.
If you find a bug in Termonad, please either send a PR fixing it or create an issue explaining it.
If you just need help with configuring Termonad, you can either join the Gitter room or #termonad on irc.freenode.net.
Contributions are highly appreciated. Termonad is currently missing many helpful configuration options and behavior hooks. If there is something you would like to add, please submit an issue or PR.
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论