File tree Expand file tree Collapse file tree 1 file changed +2
-13
lines changed
Expand file tree Collapse file tree 1 file changed +2
-13
lines changed Original file line number Diff line number Diff line change @@ -84,7 +84,7 @@ extension Application {
8484 kernel: kernel,
8585 initPath: . init( filePath: initBlock)
8686 )
87- let sigwinch = setupSigwinchHandler ( )
87+ let sigwinchStream = AsyncSignalHandler . create ( notify : [ SIGWINCH ] )
8888
8989 let current = try Terminal . current
9090 try current. setraw ( )
@@ -139,7 +139,7 @@ extension Application {
139139
140140 try await withThrowingTaskGroup ( of: Void . self) { group in
141141 group. addTask {
142- for await _ in sigwinch {
142+ for await _ in sigwinchStream . signals {
143143 try await container. resize ( to: try current. size)
144144 }
145145 }
@@ -151,17 +151,6 @@ extension Application {
151151 }
152152 }
153153
154- private func setupSigwinchHandler( ) -> AsyncStream < Void > {
155- let sigwinch = DispatchSource . makeSignalSource ( signal: SIGWINCH)
156- let stream = AsyncStream< Void> { cont in
157- sigwinch. setEventHandler {
158- cont. yield ( )
159- }
160- }
161- sigwinch. resume ( )
162- return stream
163- }
164-
165154 private static let appRoot : URL = {
166155 FileManager . default. urls (
167156 for: . applicationSupportDirectory,
You can’t perform that action at this time.
0 commit comments