mirror of
https://github.com/qvacua/vimr.git
synced 2024-11-24 11:37:32 +03:00
Open cli pipe file as read-write
- When vimr is `Ctrl-C`'ed, then O_WRONLY hangs.
This commit is contained in:
parent
018d3ee411
commit
d50e027402
@ -26,8 +26,11 @@ extension MainWindow {
|
||||
self.set(dirtyStatus: false)
|
||||
self.emit(self.uuidAction(for: .close))
|
||||
|
||||
if let cliPipePath = self.cliPipePath {
|
||||
let fd = Darwin.open(cliPipePath, O_WRONLY)
|
||||
guard let cliPipePath = self.cliPipePath, FileManager.default.fileExists(atPath: cliPipePath) else {
|
||||
return
|
||||
}
|
||||
|
||||
let fd = Darwin.open(cliPipePath, O_RDWR)
|
||||
guard fd != -1 else {
|
||||
return
|
||||
}
|
||||
@ -36,7 +39,6 @@ extension MainWindow {
|
||||
handle.closeFile()
|
||||
_ = Darwin.close(fd)
|
||||
}
|
||||
}
|
||||
|
||||
func set(title: String) {
|
||||
self.window.title = title
|
||||
|
Loading…
Reference in New Issue
Block a user