fatty 0.99.6 → 0.99.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/fatty/curses/context.rb +25 -0
- data/lib/fatty/session/shell_session.rb +2 -0
- data/lib/fatty/terminal.rb +3 -5
- data/lib/fatty/version.rb +1 -1
- metadata +15 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 24dd40c0c160795a5777f8037581bb57a6ac50523aab26f1acac275f8ebc40f7
|
|
4
|
+
data.tar.gz: 98297d22bda1eba4e68c528f7e6762667678affd8e00039582a1a75e0b697bc5
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 9e7cbad62a7862a1fe0db2f15df75238371f0aad7223418d55bb1dc5a7662a6489c56105e2e114c642762a8866f6ed8716b6ca38f9998ac2738e9615cc91b997
|
|
7
|
+
data.tar.gz: 65a14a3aef4ba1a60253f3a17162e546917b4317536c5a047ef7a0bf54f6128b5c6d284fb54450c8d2427255280aaa5bdbc15573783a2169e3f9aa4051307137
|
data/lib/fatty/curses/context.rb
CHANGED
|
@@ -1,9 +1,16 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
3
|
require "curses"
|
|
4
|
+
require "fiddle/import"
|
|
4
5
|
|
|
5
6
|
module Fatty
|
|
6
7
|
module Curses
|
|
8
|
+
module Native
|
|
9
|
+
extend Fiddle::Importer
|
|
10
|
+
|
|
11
|
+
dlload Fiddle.dlopen(nil)
|
|
12
|
+
extern "int endwin()"
|
|
13
|
+
end
|
|
7
14
|
# Context represents the active curses environment.
|
|
8
15
|
#
|
|
9
16
|
# It owns:
|
|
@@ -133,6 +140,24 @@ module Fatty
|
|
|
133
140
|
self
|
|
134
141
|
end
|
|
135
142
|
|
|
143
|
+
def suspend
|
|
144
|
+
return unless @started
|
|
145
|
+
|
|
146
|
+
::Curses.def_prog_mode
|
|
147
|
+
disable_bracketed_paste!
|
|
148
|
+
::Curses.curs_set(1)
|
|
149
|
+
Native.endwin
|
|
150
|
+
nil
|
|
151
|
+
end
|
|
152
|
+
|
|
153
|
+
def resume
|
|
154
|
+
return unless @started
|
|
155
|
+
|
|
156
|
+
::Curses.refresh
|
|
157
|
+
enable_bracketed_paste!
|
|
158
|
+
nil
|
|
159
|
+
end
|
|
160
|
+
|
|
136
161
|
def close
|
|
137
162
|
close_windows
|
|
138
163
|
if @started
|
|
@@ -50,6 +50,8 @@ module Fatty
|
|
|
50
50
|
when :terminal_paste
|
|
51
51
|
field.act_on(:paste, command.payload.fetch(:text, ""), env: action_env(event: nil))
|
|
52
52
|
[]
|
|
53
|
+
when :resize
|
|
54
|
+
Command.session(output_session.id, :resize)
|
|
53
55
|
when :popup_result
|
|
54
56
|
apply_popup_result(command.payload)
|
|
55
57
|
when :paste
|
data/lib/fatty/terminal.rb
CHANGED
|
@@ -177,14 +177,12 @@ module Fatty
|
|
|
177
177
|
|
|
178
178
|
# --- Suspension ------------------------------------------------
|
|
179
179
|
|
|
180
|
-
# Suspend fatty and run the block in the normal terminal, then restore
|
|
181
|
-
# fatty's terminal on exit.
|
|
182
180
|
def suspend
|
|
183
|
-
|
|
181
|
+
ctx.suspend
|
|
184
182
|
yield
|
|
185
183
|
ensure
|
|
186
|
-
|
|
187
|
-
|
|
184
|
+
ctx.resume
|
|
185
|
+
renderer.invalidate!
|
|
188
186
|
render_frame
|
|
189
187
|
end
|
|
190
188
|
|
data/lib/fatty/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: fatty
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.99.
|
|
4
|
+
version: 0.99.8
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Daniel E. Doherty
|
|
@@ -107,6 +107,20 @@ dependencies:
|
|
|
107
107
|
- - ">="
|
|
108
108
|
- !ruby/object:Gem::Version
|
|
109
109
|
version: '0'
|
|
110
|
+
- !ruby/object:Gem::Dependency
|
|
111
|
+
name: fiddle
|
|
112
|
+
requirement: !ruby/object:Gem::Requirement
|
|
113
|
+
requirements:
|
|
114
|
+
- - ">="
|
|
115
|
+
- !ruby/object:Gem::Version
|
|
116
|
+
version: '0'
|
|
117
|
+
type: :runtime
|
|
118
|
+
prerelease: false
|
|
119
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
120
|
+
requirements:
|
|
121
|
+
- - ">="
|
|
122
|
+
- !ruby/object:Gem::Version
|
|
123
|
+
version: '0'
|
|
110
124
|
description: |
|
|
111
125
|
fatty is a pure Ruby curses-backed terminal interaction library with editable single-line input, scrollable output, and
|
|
112
126
|
programmable keybindings, inspired by modern shells like fish.
|