termonad-4.5.0.0: Terminal emulator configurable in Haskell
Safe HaskellSafe-Inferred
LanguageHaskell2010

Termonad.Term

Synopsis

Documentation

computeTabLabel Source #

Arguments

:: Int

Tab number. 0 is used for the first tab, 1 for the second, etc.

-> Maybe Text

A possible title for a tab. If this is Nothing, then the string shell will be used.

-> Text 

Compute the text for a Label for a GTK Notebook tab.

>>> computeTabLabel 0 (Just "me@machine:~")
"1. me@machine:~"
>>> computeTabLabel 5 (Just "bash process")
"6. bash process"
>>> computeTabLabel 2 Nothing
"3. shell"

relabelTab :: Notebook -> Label -> ScrolledWindow -> Terminal -> IO () Source #

Update the given Label for a GTK Notebook tab.

The new text for the label is determined by the computeTabLabel function.

cwdOfPid :: Int -> IO (Maybe Text) Source #

TODO: This should probably be implemented in an external package, since it is a generally useful utility.

It should also be implemented for windows and osx.

getCWDFromFocusedTab :: TMNotebook -> IO (Maybe Text) Source #

Get the current working directory from the shell in the focused tab of a notebook.

Returns Nothing if there is no focused tab of the notebook, or the current working directory could not be detected for the shell.

createAndInitVteTerm :: FontDescription -> ConfigOptions -> IO Terminal Source #

Create the VTE Terminal, set the fonts and options

launchShell Source #

Arguments

:: Terminal

GTK Terminal to spawn the shell in.

-> Maybe Text

An optional path to the current working directory to start the shell in. If Nothing, use the current working directory of the termonad process.

-> IO Int 

Starts a shell in a terminal and return a new TMTerm

addPage Source #

Arguments

:: TMState 
-> TMNotebookTab 
-> Box

The GTK Object holding the label we want to show for the tab of the newly created page of the notebook.

-> IO () 

Add a page to the notebook and switch to it.

setFocusOn :: ApplicationWindow -> Terminal -> IO () Source #

Set the keyboard focus on a vte terminal

createTerm Source #

Arguments

:: (TMState -> EventKey -> IO Bool)

Funtion for handling key presses on the terminal.

-> TMState 
-> IO TMTerm 

Create a new TMTerm, setting it up and adding it to the GTKNotebook.

handleMousePress :: ApplicationWindow -> Terminal -> EventButton -> IO Bool Source #

Popup the context menu on right click