〜ともなく・〜ともなしに
without meaning to, idly; (from) somewhere or other
Verb dictionary form + ともなく · Question word (+ particle) + ともなく
Sign up free to review this point on a spaced schedule.
ともなく describes an action done idly, without a clear intention: 見るともなくテレビを見ていた, "I was idly watching TV". The verb is usually repeated: 見るともなく見る, 聞くともなく聞く, 考えるともなく考える.
With a question word, it means "some … or other": どこからともなく, "from somewhere or other". 誰に言うともなく means "to no one in particular".
ともなしに means the same. It's literary and descriptive, common in novels.
Compare ことなく (N2), "without doing", which states that something didn't happen at all. With ともなく, the action does happen, just without intent. It paints a relaxed, absent-minded scene, which is why novelists like it.
Examples
見るともなくテレビを見ていた。
I was idly watching TV.
聞くともなく、隣の人の話が耳に入った。
Without really meaning to listen, I overheard the people next to me.
どこからともなく、いい匂いがしてきた。
A nice smell came wafting from somewhere or other.
考えるともなく、昔のことを考えていた。
I found myself idly thinking about the past.
彼は誰に言うともなく、「疲れた」とつぶやいた。
He muttered "I'm tired" to no one in particular.