Giter Club home page Giter Club logo

kermit's Introduction

kermit Release AUR

A VTE-based, simple and froggy terminal emulator.

Kermit the Frog

VTE is a GTK widget that is designed to create virtual terminal emulators. GNOME Terminal, ROXTerm and evilvte are a few examples of terminal emulators that use the VTE widget. With the case of kermit, although it is a "yet another" VTE implementation, it aims to keep everything simple and customizable while providing some additional features.

The project is inspired by Vincent Bernat's article and also his implementation of a custom VTE-based terminal. Terminal features and appearance are mostly influenced by Rxvt, termite and st.

Table of Contents

Installation

AUR

CMake

mkdir -p build && cd build
cmake ../ -DCMAKE_INSTALL_PREFIX=/usr
make
sudo make install
sudo ldconfig

Make

make
sudo make install

GCC

cd src/
gcc -s -O3 -Wall -Wno-deprecated-declarations $(pkg-config --cflags vte-2.91) kermit.c -o kermit.o $(pkg-config --libs vte-2.91)

* kermit depends on vte3 and gtk3 packages.

Features

  • Uses the default shell ($SHELL)
  • Supports transparency with a composite manager (such as compton)
  • Supports base16 color schemes (customizable theme)
  • Supports custom keys and associated commands
  • Supports tabs

Arguments

kermit [-h] [-v] [-d] [-c config] [-t title] [-w workdir] [-e command]

[-h] shows help
[-v] shows version
[-d] enables the debug messages
[-c config]  specifies the configuration file
[-t title]   sets the terminal title
[-w workdir] sets the working directory
[-e command] sets the command to execute in terminal

Default Key Bindings

Key Action
ctrl + alt + c Copy to clipboard
ctrl + alt + v Paste from clipboard
ctrl + alt + t/return Open a new tab
ctrl + alt + n Open a new window
ctrl + alt + r Reload configuration file
ctrl + alt + d Load default configuration
ctrl + alt + q Exit the terminal
ctrl + alt + k/up Increase font size
ctrl + alt + j/down Decrease font size
ctrl + alt + equals/plus Reset font size to default
ctrl + alt + <num> Switch to tab with number <num>
ctrl + alt + l/right/pageup Switch to next tab
ctrl + alt + h/left/pagedown Switch to previous tab
ctrl + alt + backspace Close the current tab

The default modifiers (ctrl + alt) can be set to ctrl + shift using the config file. Key bindings can be overridden by custom key bindings. See Configuration / Key Bindings for more information.

Customization

Config File

Most of the settings including font, opacity and colors can be changed via the config file. The default configuration file is available here.

kermit looks for configuration file in ~/.config/kermit.conf

Theme

The terminal theme can be changed by either editing the config file manually or using the base16 color schemes in orhun/base16-kermit repository.

Font

kermit uses a PangoFontDescription which is retrieved from the kermit.conf for changing the font family, style and size. The configuration entry format of the font and some examples are shown below and the default value is monospace 9.

font [FAMILY-LIST] [STYLE-OPTIONS] [SIZE]

FAMILY-LIST is a comma-separated list of families optionally terminated by a comma, STYLE_OPTIONS is a whitespace-separated list of words where each WORD describes one of style, variant, weight, or stretch, and SIZE is a decimal number (size in points).

• Available font families: Normal, Sans, Serif and Monospace. • Available styles: Normal, Oblique, Italic. • Available weights: Ultra-Light, Light, Normal, Bold,Ultra-Bold, Heavy. • Available variants: Normal, Small-Caps. • Available stretch styles: Ultra-Condensed, Extra-Condensed, Condensed, Semi-Condensed, Normal, Semi-Expanded, Expanded, Extra-Expanded, Ultra-Expanded.

Examples:

font sans bold 12
font normal 10
font monospace bold italic condensed 12

Key Bindings

Custom keys and associated commands can be specified with the configuration file. An example entry is available here and entry format is shown below.

bind/bindx/bindi [KEY]~"[COMMAND]"
  • bind: Send command to the terminal.
  • bindx: Send command to the terminal and execute.
  • bindi: Execute internal command

Examples:

bindx f~"df -h"
bind r~"rm -i "
bind p~"ps aux | grep "
bind k~"kill -9 "
bindi c~"copy"

Currently available internal commands (bindi):

  • copy: copy to clipboard
  • paste: paste from clipboard
  • reload-config: reload config
  • default-config: load default config
  • new-tab: open new tab
  • exit: exit kermit
  • inc-font-size: increase font size by 1
  • dec-font-size: decrease font size by 1
  • default-font-size: reset font size to default
  • next-tab: go to next tab
  • prev-tab: go to previous tab
  • close-tab: close current tab
  • new-window: open new window with same working directory (requires vte.sh).

Padding

In order to change the padding of the terminal, create ~/.config/gtk-3.0/gtk.css if it does not exist, specify the values there and restart the terminal.

VteTerminal,
TerminalScreen,
vte-terminal {
  padding: 3px 2px 2px 1px;
}

The command below can be used to create the both configuration files.

curl https://raw.githubusercontent.com/orhun/kermit/master/.config/kermit.conf --output ~/.config/kermit.conf && \
  printf "VteTerminal,\nTerminalScreen,\nvte-terminal {\n\tpadding: 3px 2px 2px 1px;\n}\n" > ~/.config/gtk-3.0/gtk.css

Screenshots

Screenshot

TODO(s)

  • URL handling

License

GNU General Public License v3.0 only (GPL-3.0-only)

Copyright

Copyright © 2019-2024, Orhun Parmaksız

kermit's People

Contributors

andersontorres avatar blitzkraft avatar jzbor avatar markand avatar orhun avatar sulincix avatar xegrox avatar

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

kermit's Issues

initial terminal size

set initial columns and rows values in config. i'm not sure whether it's implemented yet tho since couldn't find the setting in the default config file.
is it possible to accomplish this through gtk.css? or maybe in the source code?

edit: as a workaround in openbox WM i put these in rc.xml:

<application name="kermit*" class="*" type="normal">
    <size>      
        <height>538</height>      
        <width>958</width>
    </size>
</application>

regards
thank you.

Wrong syntax highlighting

2020-03-13-06:51:42PM

Left one is k3rmit, right one is a different terminal.
k3rmit has different syntax colors in neovim for some reason.

Cloning the terminal does not work for bash

This was implemented in #24

For me I'm getting an additional path prefix so the cloning does not work:

file://thinkpad/home/orhun/gh/kermit

Unable to change pwd for new terminal: No such file or directory

It should be /home/orhun/gh/kermit instead.

As of now I don't know why this happens.

Color difference

I've found there's a color difference, in GIMP select the backgrounds color and they show to both be set as #404522 but k3rmit is different than Urxvt. Is this a bug or is there a solution to fixing this in the config?
Screenshot from 2020-05-18 01-17-46

-e option not work

I just try to start the k3rmit -e micro command, but it returns with bus error(coredump).
I try my all consol app (lf mg mc) with same error.
But if I open k3rmit and then start this apps everything is OK.
Is this option implemented?

FreeBSD and k3rmit 2.1 build from source.

Title option crashes terminal

Launching a terminal with k3rmit --title ... causes the terminal to open then close immediately although this option doesn't seem to be implemented yet

-t option not working with zsh as default $SHELL

With /usr/bin/zsh or /bin/zsh as the default $SHELL:

Alacritty, kitty and st work as expected with their respective -t options but kermit does not. However, if I do

kermit -e $(which bash) -t Foo

then the -t option works.

If I change SHELL to /bin/bash, then the -t option for kermit works, but if I do

kermit -e $(which zsh) -t Foo

the option stops working again.

With the fish shell the option also works as expected.

Cursor shape option

Will you add the option to change the cursor shape, for example like bar (|) or underscore(_)?

Cmake does not install manpage

Hello! I am Anderson, a Nixpkgs maintainer.

While I was building a script for kermit on Nixpkgs, I have noticed cmake did not install the manpages automatically.
Well, that's it!

Let Control+W pass through

Hello,

Currently k3rmit interprets Control+W as a tab closing command. This is a pretty common readline binding (that deletes the word before the cursor), so I would suggest to switch that to something else.

In general, I think it would be good to avoid binding anything to Control+Letter as those are frequently used by terminal applications.

Themeing

Can you add a way to customize theme options? Something so that base-16 works? Example of how the format can look.

Vim launches with black screen.

Vim and Neovim both launches with a completely black screen, not showing the contents of the file I'm opening or anything else.

"Smart" Copy

I know that this seems too complex to kermit, but would be possible to implement the "smart" copy/paste feature?

This feature consists in the terminal recognizing if control+c/v is for cancelling a process or to copy/paste something.

Terminator, that is also Vte based, implemented that too. For reference: gnome-terminator/terminator#242

Just asking. If is out of scope, I won't question your motives and just close this issue.

Thanks!

A kermit is a kermit is a kermit is a kermit

I was looking around to see if the source code for Kermit, the famous terminal emulator & file transfer protocol of the 1980s and 1990s, was available on github. While I am happy that the Kermit name lives on in this project, it would be nice if this new Kermit made a nod to the old.

For example, it would be cool if it could handle file transfers, which was the primary use of Kermit. For example, if a person using your terminal program sshes from machine to machine and then realizes there's a file they want to send from that remote server to their local computer, they could just run:

$ kermit -s foo

and, hey presto, via the magic of Kermit, foo is now on their computer. (The kermit command in this example is available on most Unix systems when you install the ckermit package).

What do you think?

Feature Request: Open new window in current PWD

Hi,
I am considering switching to kermit from my own vte implementation, but I really depend on one feature:
I use Ctrl+Return to spawn a new window with the working directory set to the current one. You can find the implementation here. The main functionality is provided by vte through vte_terminal_get_current_directory_uri().

Also is it possible to remap the default keys (i.e. use a different key for one of the default actions or remove a binding for one of the default actions)?

Thanks for the great work!

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.