Commit Graph

329 Commits

Author SHA1 Message Date
Daniel Lockyer f7c0aa54ed main: add some free calls to free GOptionContext
Free the GOptionContext when we are done parsing it
in termite.cc@main.
2016-04-27 21:37:22 +02:00
Daniel Pfeifer be3eec81c0 compile url_regex with G_REGEX_MULTILINE
vte_terminal_match_add_gregex wants that to be set.
see: https://github.com/thestinger/vte-ng/blob/0.44.1-ng/src/vtegtk.cc#L1718
2016-04-26 12:01:36 +02:00
Kenneth Lyons b219f171c9 Prefer $SHELL over login shell. 2016-04-08 23:12:14 -07:00
Kenneth Lyons d91ce8d614 Add command line switch to set icon. 2016-04-08 23:04:42 -07:00
Jelle van der Waa 00035a6db4 Replace deprecated vte_terminal_match_check
vte_terminal_match_check has been replaced by
vte_terminal_match_check_event which takes the GdkEvent
and does not need to be passed a row and col.
2016-03-22 20:43:28 +01:00
Jelle van der Waa c747c9317e Resolve missing field 'font_scale' initializer
The font_scale member of the struct config_info was not
initialized.
2016-03-21 21:34:30 +01:00
Daniel Micay 3563fb5314 Merge pull request #295 from jelly/gtk3-resolve-deprecations
Resolve GTK3 deprecation warnings
2016-02-08 10:10:19 -05:00
Jelle van der Waa 62a97deb69 Resolve GTK3 deprecation warnings
Remove the search_panel_info's panel, which was an alignment
widget for the entry widget. Since the entry widget can now
set alignment using it's margin properties.

Replace gtk_alignment_set_padding with gtk_widget_set_margin_*.

These changes make termite depend on GTK3 >= 3.14.
2016-02-05 21:17:31 +01:00
Jelle van der Waa 5d099931e3 Reset font size to startup default using a keybinding
Reset the font size to the default startup value
by pressing '=' in selection mode.

Closes: #164
2016-01-18 20:13:23 +01:00
Daniel Micay 1a7ce26028 Merge pull request #257 from holomorph/modify-other-keys
Modify other keys
2016-01-08 16:24:30 -05:00
Jelle van der Waa 20c9500fbe Add a null check when pressing backspace
Closes: #270
2016-01-08 22:22:19 +01:00
Mark Oteiza 614eca0f03 produce escape sequences for some Ctrl-Meta- modified keys 2015-10-17 09:35:30 -04:00
Mark Oteiza ab78455a4a make table an argument of modify_other_keys 2015-10-17 09:35:30 -04:00
Mark Oteiza b10a5f2fac Make only possible hints visible
Originally written by numeral <numerical@gmail.com>
2015-09-18 22:53:34 -04:00
Daniel Micay 4b08fd998b style fixes 2015-09-18 18:53:15 -04:00
Daniel Micay ba63e3c33c add padding to base/min size hints
Closes #174
2015-09-18 18:51:53 -04:00
Daniel Micay eb1628c867 use xdg-open as the default fallback browser 2015-06-26 10:04:46 -04:00
Daniel Micay 0652af0220 improve compatibility with non-X11 backends 2015-06-22 13:26:34 -04:00
Daniel Micay 2b5af377aa stop setting VTE_VERSION, as VTE sets it now 2015-06-22 13:06:06 -04:00
Daniel Micay 86e2bc88e8 style fixes 2015-06-22 12:36:24 -04:00
Daniel Micay b1349a52ea deal with gtk_widget_override_background_color deprecation 2015-06-22 12:31:41 -04:00
Daniel Micay 91bdd0dcbd add technically required (no-op) g_spawn_close_pid 2015-06-22 12:09:12 -04:00
Matt Kemp ecd495d737 Added Q as a key to return to insert mode. 2015-05-24 16:37:02 -05:00
Mark Oteiza fa1943c76e Set color palette size to 256
Required by vte 0.40.0
2015-04-10 05:39:53 -04:00
Daniel Micay 0928a1112a fix bépo command mode binding
Closes #214
2015-03-24 19:20:29 -04:00
Simon Gomizelj cb3dfb71a0 Screwed up my iterators, sorry 2014-11-10 21:04:09 -05:00
Simon Gomizelj e2c9769f38 Match gnome-terminal with its font scaling logic
Gnome terminal jumps between a predefined set of font scales. libvte seems
to break if we try to jump in between them. This behaviour is an exact
match from what you get in gnome-terminal (and certainly looks
considerably better).

Relevant to issue #195.
Closes #194 since it no longer crashes.
Probably a proper fix (finally) for #47.
2014-11-10 20:45:02 -05:00
Simon Gomizelj bed98f83e8 Port font scaling to the new VTE API
Closes #195
2014-11-10 20:12:23 -05:00
Daniel Micay cc34465621 fix unused parameter warning 2014-10-27 12:53:26 -04:00
Daniel Micay 96668c23cf rm resize grip setting, gtk dropped support for it 2014-10-27 12:39:26 -04:00
Daniel Micay 7612e90369 add back support for transparency
Closes #191
2014-10-27 12:25:58 -04:00
Daniel Micay 05f3bbf626 rm obsolete visual bell call (not in VTE anymore) 2014-09-21 22:54:24 -04:00
Daniel Micay e63d868ed6 use the vte_terminal_spawn_sync wrapper
The vte_ptr_set_term function is gone, so there's no reason to create
the pty object manually.
2014-09-21 20:35:25 -04:00
Mark Oteiza be4e2faf73 add ^B and ^F for paging in selection mode 2014-09-21 19:43:34 -04:00
Daniel Micay e4ad66736a rm extra newline 2014-09-21 19:20:48 -04:00
Daniel Micay 7f03ded730 port to vte 0.38.0
VTE is not making any attempt to maintain API stability. The following
changes to the API impacted Termite, despite it avoiding deprecated
functions:

* vte_pty_set_term removed (hopefully without an impact...)
* vte_terminal_get_child_exit_status replaced with new signal parameter
* beep signal -> bell signal
* vte_char_attributes -> VteCharAttributes
* sync suffix added to I/O functions along with some parameter changes
* rgba suffix removed from all color functions
* inner-border attribute replaced with GtkStyleContext padding
* vte_terminal_set_font_from_string removed, use Pango directly
* vte_terminal_is_word_char removed - is_word_char copied to Termite
* vte_terminal_set_word_chars removed - feature dropped
* vte_terminal_set_visible_bell removed - feature dropped

Support for text selection is still not supported upstream. The required
API is tiny and does not expose internal details. Despite the lack of a
compelling reason to leave it out like a backwards compatibility risk,
the patch has been left to rot on the bug tracker.

The vte_terminal_get_user_shell_with_fallback API was also removed,
although it was an internal API and Termite was only using it for
convenience. The functionality has been moved inside Termite.

Closes #187
2014-09-21 19:11:40 -04:00
Simon Gomizelj 76a707b665 use std::unique_ptr in more places 2014-08-24 12:07:27 -04:00
Simon Gomizelj d20bee9a34 Add 'fullscreen' conf setting to disable F11
Settings fullscreen to false prevents termite from intercepting F11.

See #144
2014-06-26 23:58:55 -04:00
Simon Gomizelj 85f8a2691a fix memory leak 2014-03-08 18:24:48 -05:00
Simon Gomizelj 3b078b83a0 Query padding before drawing hints
Hints are not getting placed in the right place when vte has an
inner-padding. Start taking this into consideration.

Relevant to issue #162
2014-03-08 17:32:40 -05:00
Simon Gomizelj 2bf484277b Fix vte padding calculations.
Sometimes we only care about left and top offsets. get_vte_padding is
currently returning left + right and top + bottom, leading to
check_match miscalculating its offsets.

Closes #162
2014-03-08 17:32:40 -05:00
Mark Oteiza d4f8e66568 provide a modify_other_keys config option. defaults to false 2014-03-07 19:45:39 -05:00
Mark Oteiza 4416affc56 produce escape sequences for extra Ctrl- modified keys
current xterm has the resource modifyOtherKeys which, when enabled,
constructs escape sequences for many Ctrl-, Shift-, and Meta- modified
keys.  This implements support for some Ctrl- modified keys.
2014-03-04 14:10:42 -05:00
Simon Gomizelj 9edd015348 make error messages more self-consistent 2014-02-25 21:31:54 -05:00
Simon Gomizelj 190a1d01ee check and report errors in launch_browser
Just in case issues like #141 pop up again, lets have more debugging
and error reporting.
2014-02-25 21:22:19 -05:00
Simon Gomizelj 343140c8db error message should end in newline 2014-02-25 21:16:56 -05:00
Simon Gomizelj 95343b1e3f refactor button_press_cb callback 2014-02-21 22:33:44 -05:00
numeral 23591fd14f Copy URI to XA_CLIPBOARD on right click
Small patch that copies the match into the default clipboard using
gtk_clipboard_set_text(). Maybe consider which clipboard to use
(such as PRIMARY OR SECONDARY) instead based on a config option, although
that may be overkill (especially since PRIMARY is supposed to be ephemeral
or something)

Signed-off-by: Simon Gomizelj <simongmzlj@gmail.com>
2014-02-21 22:30:41 -05:00
Simon Gomizelj 0a538af4d7 fix up warning from scan-build 2013-12-29 00:36:59 +00:00
Simon Gomizelj b913de35bb make F11 toggle fullscreen 2013-12-08 19:17:58 -05:00
Simon Gomizelj ccb881068c silence unusued parameter warning 2013-12-04 16:23:09 -05:00
Mark Oteiza 491ab37a56 enable escaping overlays with C-[ 2013-12-04 13:32:14 -05:00
Simon Gomizelj c1d65c416e check if browser is null, not if clickable_url is false
Hints don't make sense if there's no browser set, but checking if
browser is null makes for cleaner code. Note this wasn't wrong,
clickable_url will be set to false if browser is null.
2013-11-25 00:35:10 -05:00
Simon Gomizelj a05fdcd4d1 better warning for no browser 2013-11-23 20:37:18 -05:00
Simon Gomizelj c2211c0496 if no browser, disable url hints 2013-11-23 20:36:48 -05:00
Simon Gomizelj 476a26c5f7 disable clickable_url when no browser configured 2013-11-23 20:34:40 -05:00
Simon Gomizelj f493b4c83e clickable_url should be false whenever browser isn't set 2013-11-23 20:20:41 -05:00
Abdo Roig-Maranges 0994063fac return success when window is closed 2013-11-01 15:34:08 +01:00
Simon Gomizelj dc9948bbd1 Reload config file on SIGUSR1
Refactor config reloading into a lambda stored globally.

Closes #131
2013-10-23 15:07:41 -04:00
Daniel Micay 9baf7c94e1 rm support for transparency (deprecated upstream)
I considered replacing this with `gtk_widget_set_opacity`, but it's no
more usable than window manager transparency since the font is transparent.

Since this is already broken with URL hints and won't be around in the
future, it might as well go sooner rather than later.

Closes #128
Closes #39
2013-10-19 16:45:29 -04:00
Simon Gomizelj b47ad17efb Fix up hints to match the GdkColor -> GdkRGBA switch
We no longer need to convert from ints to doubles, GdkRGBA already
provides doubles.

Closes #129
2013-10-14 23:42:51 -04:00
Daniel Micay 7593d77027 switch from GdkColor -> GdkRGBA
The old type is on the way out and `gtk_widget_modify_bg` has already
been marked as deprecated.

Closes #124
2013-10-13 12:06:39 -04:00
Daniel Micay 6da9e28e20 Revert "switch from GdkColor -> GdkRGBA"
This reverts commit 172a79223b.

temporary revert - default color calculation needs to be updated
2013-10-12 19:24:14 -04:00
Daniel Micay 172a79223b switch from GdkColor -> GdkRGBA
The old type is on the way out and `gtk_widget_modify_bg` has already
been marked as deprecated.

Closes #124
2013-10-12 18:26:57 -04:00
Daniel Micay 1cb51e3665 drop support for pseudo-transparency
This has been deprecated upstream, and there isn't going to be a way to
preserve the functionality. True transparency is also deprecated as a
feature of the VTE widget, but should be possible with GTK itself.
2013-10-12 18:23:05 -04:00
Simon Gomizelj f0ff025c1b set bold colour to foreground too just in case
Fixes #118
2013-08-24 12:20:04 -04:00
Simon Gomizelj 72f51a5be1 size hints should be recalulcated on font resizing 2013-08-07 15:18:48 -04:00
Simon Gomizelj 181723932f cleanup the mess of structures somewhat 2013-08-07 15:16:34 -04:00
Evan Purkhiser 7982fac85c Add option for enabling size hints for the window
Cleaned up per discussion on #112
2013-08-07 14:53:40 -04:00
Mark Oteiza 840e16527e add C-[ as a binding to leave command mode 2013-07-15 12:30:30 -04:00
numeral d9a9765a61 Make Pseudo Transparency Work!
Added pseudo_transparency bool in info_config struct, and changed set_opacity
to use it for vte_set_background_transparent().
2013-06-17 12:04:58 -04:00
Simon Gomizelj 86b6842b59 fix whitespace indent level
@Xecantur: please don't mess with the whitespace
2013-06-17 02:10:46 -04:00
Simon Gomizelj 85d49aca17 reorder options in manpage and --help 2013-06-17 02:07:24 -04:00
Simon Gomizelj 7c949dc22d don't convert float to bool 2013-06-17 02:07:24 -04:00
Justin Strickland 30ec184e77 implement --transparency/-x at the command line
Closes #100
2013-06-17 02:07:20 -04:00
Simon Gomizelj a9ba1e9913 set VTE_VERSION to what gnome-terminal sets it
Addresses issue #99
2013-06-14 14:31:35 -04:00
Simon Gomizelj 661ededa76 docs: fix up man and usage for --title 2013-06-13 02:58:40 -04:00
numeral e50b25a05c Add option to set arbitrary window name
Added main() level scoped char* to hold title. Added a GOptionEntry
for grabbing the title with a switch. If the switch is given we
force dynamic title to be false and don't connect vte window title
change signal to top level window change. That is all folks.

Signed-off-by: numeral <numerical@gmail.com>
2013-06-04 02:09:05 -04:00
Simon Gomizelj 906301f977 set window background colour too
Setting the window background window won't remove the flickering, but
it should prevent it from being so glaring.

If it works, this fixes #87.
2013-06-02 12:19:15 -04:00
Daniel Micay f39741347b set 100 columns as the long line limit 2013-04-12 07:00:08 -04:00
Simon Gomizelj 0b66678c01 don't actually need lambda's here 2013-04-11 21:10:51 -04:00
Simon Gomizelj 56ac2acf44 if the search fails, clear selection and try again
This really smells like we're working around a vte bug/limitation.
Thanks to @numerical.

This closes #76
2013-04-11 21:06:16 -04:00
Simon Gomizelj 05eb389c48 use nullptr over NULL everywhere 2013-04-11 15:35:05 -04:00
Simon Gomizelj fb163c61da fix memory leak handling hints 2013-04-11 15:34:32 -04:00
numerical 63f52cea8b Improve and add colour to possible hint matches
Changed URL hinting to be a lot smarter and to colour hints when
possible matches are found.

- Add active_foreground and active_background config options
- Add a new char* to hold entry text for checking against when redrawing

Signed-off-by: numeral <numerical@gmail.com>
Signed-off-by: Simon Gomizelj <simongmzlj@gmail.com>
2013-03-26 19:26:18 -04:00
Simon Gomizelj 74621daafe add license header to termite.cc
Addresses issue #68
2013-03-20 16:38:52 -04:00
Daniel Micay 1b32c0af7f make geometry switch override the config file
Closes #69
2013-03-15 18:06:50 -04:00
numerical c9636931ca smarter url hints 2013-03-03 07:14:30 -05:00
Daniel Wallace b40bc580cb check against visual_bell option 2013-02-22 00:08:29 -05:00
Daniel Micay 6fb386b544 make the quick_url behavior the only option 2013-02-20 03:40:43 -05:00
Daniel Micay c0af43dd53 rm the comma-separated hint feature 2013-02-20 03:19:04 -05:00
Daniel Micay 329e4ff9c6 calculate the # of digits with log10 and free str 2013-02-20 02:54:05 -05:00
Daniel Micay f0c3f1a0f6 check for non-digits isn't necessary
launch_url does this already
2013-02-20 02:38:19 -05:00
Daniel Micay c41934c5fd make style consistent 2013-02-20 02:38:06 -05:00
Ofear 928dc07fd8 add config option quick_url (defaults to off) to turn on quick url selection in the urlselection overlay 2013-02-19 18:19:38 -05:00
Ofear 30ec7ad3a6 change urlselect overlay to immediately select a link once the number of digits inputted is equal to the number of digits in the largest link 2013-02-19 16:57:29 -05:00
Hǎiliàng Wáng 567cb930fd Add support for setting configuration file path. 2013-01-21 01:10:08 +08:00
Daniel Micay 16426ed18f move configuration file to a directory 2013-01-06 19:26:11 -05:00
Daniel Micay 9faaf34665 free the directory argument 2013-01-05 00:09:06 -05:00
Daniel Micay f327726f88 get rid of 'hints' global 2013-01-05 00:03:48 -05:00